Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getContents($url) {
- $ch = curl_init();
- $timeout = 5;
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
- $data = curl_exec($ch);
- curl_close($ch);
- if ($data == FALSE or empty($data)) {
- return false;
- } else return $data;
- }
- $_USER=''; $isLogged = getContents("http://localhost/inc/api/isLogged.api?callback=?");
- if (isset($isLogged) && !empty($isLogged)) { $_USER = json_decode($isLogged); }
- var_dump($_USER->uname);
Advertisement
Add Comment
Please, Sign In to add comment