Hjaelp til Curl script der ikke goer som det skal
Hej alle.Jeg har et problem med et license check i curl
Jeg har en database kaldet apt med 3 felter inden i:
id , licensecode, status23
Mit curl script er saaledes:
<?php
error_reporting(-1);
$url = 'http://techhost24.com/licensecheck.php';
$ch = curl_init();
if($ch === false)
{
die('Failed to create curl object');
}
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_POST, true);
// The submitted form data, encoded as query-string-style name-value pairs
$post_data = '?code23=2356';
curl_setopt ($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
curl_close ($ch);
if ($output=='ok'){
echo "<h3>We are licensed go on";
}
else {
echo "Sorry we are not allowed";
}
echo $output;
?>
scriptet er uploaded paa http://www.techhost24.com/test23.php
Sammen med licensecheck.php
http://www.techhost24.com/licensecheck.php
Licensecheck.php giver status ok
licensecheck.php script:
if ($code23==$licensecode AND $status=='ok'){
echo'ok';
}
else {
echo'false';
}
?>
Men i test23 giver den false