Created
October 23, 2019 07:49
-
-
Save iam-vipul/89a864d58dba8b677e192809ae3ba259 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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