Hi! Could we please enable some services and cookies to improve your experience and our website?

PHPize | SQLize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear

Stuck with a problem? Got Error? Ask AI support!

Copy Clear
Copy Format Clear
<?php $userpass=[ "grant_type"=>"password", "username"=>"rooter", "password"=>"retoor0907" ]; $login = curl_init(); curl_setopt($login,CURLOPT_URL,"https://a.onenetwork-system.xyz/api/admin/token"); curl_setopt($login, CURLOPT_HTTPHEADER, array( 'Accept: application/json', 'Content-Type: application/json')); curl_setopt($login,CURLOPT_RETURNTRANSFER,true); curl_setopt($login,CURLOPT_POSTFIELDS,json_encode($userpass)); if (curl_error($login)) { echo "Curl error: " . curl_error($login); curl_close($login); exit; } $logres = curl_exec($login); curl_close($login); $logdata= json_decode($logres,true); echo $logdata["access_token"]; ?>
Copy Clear