Skip to content

Instantly share code, notes, and snippets.

@iam-vipul
Created October 23, 2019 07:49
Show Gist options
  • Save iam-vipul/89a864d58dba8b677e192809ae3ba259 to your computer and use it in GitHub Desktop.
Save iam-vipul/89a864d58dba8b677e192809ae3ba259 to your computer and use it in GitHub Desktop.
<?php
if(isset($_GET['username']) && isset($_GET['password'])) {
//end point url local server.
$url="https://www.apvera.com/RetunJsonSubscription.php";
$type='Get';
$username='admin';
$password='password';
if($username==$_GET['username'] && $password==$_GET['password']) {
$ResponseJsonBody=api_call($type,$url);
print_r($ResponseJsonBody);
}else{
echo "Invalid password";
}
}else{
echo "Invalid username & password";
}
function api_call($type,$url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT,30);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$result = curl_exec($ch);
return $result;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment