I just played with PHP Curl for the first time and wrote a sample code, but I don't know how to pass the parameters in the URL correctly.
Remote Site Code:
if(isset($_REQUEST['updateme']))
{
$license = $Gauntlet->filter($_REQUEST['licensekey']);
$domainnew = $Gauntlet->filter($_REQUEST['domainnew']);
$domainold = strtolower($_SERVER['REMOTE_ADDR']);
$sqlcheckexist = "SELECT * FROM licenses WHERE licensekey = '$license' AND host = '$domainold' AND status = 'active'";
$querycheck = $DatabaseHandler->query($sqlcheckexist);
if($querycheck)
{
if($querycheck->num_rows < 1){
$json['status'] = 301;
$json['message'] = 'Wrong Domain or License';
}else{
$sqlupdate = "UPDATE licenses SET host = '$domainnew', status = 'active' WHERE licensekey = '$license'";
$json['message'] = 'Success!';
}
}
}
Remote Site API Url: mydomain.com/myapi/
How can i do this REQUEST
in Url with parameters if i POST
licensekey
and domainnew
and Update
my Database value?