The funniest problem is that I got everything correct already. But when I try running the script and see if it works, it gives me "Invalid Parameter". Not too sure what's wrong but if you actually enter the URL into the browser, it will work perfectly fine.
Something is definitely wrong somewhere. Can someone actually help me by telling me what I did wrong or where is wrong?
$MerchantCode = "12345";
$RefNo = "22";
$Amount_Paid = "1.00";
function Requery(){
$query = "http://www.mobile88.com/epayment/enquiry.asp?MerchantCode=" .
$MerchantCode . "&RefNo=" . $RefNo . "&Amount=" . $Amount_Paid;
$url = parse_url($query);
$host = $url["host"];
$path = $url["path"] . "?" . $url["query"];
$timeout = 1;
$fp = fsockopen ($host, 80, $errno, $errstr, $timeout);
if ($fp) {
fputs ($fp, "GET $path HTTP/1.0\nHost: " . $host . "\n\n");
while (!feof($fp)) {
$buf .= fgets($fp, 128);
}
$lines = split("\n", $buf);
$Result = $lines[count($lines)-1];
fclose($fp);
} else {
# enter error handing code here
}
return $Result;
}
$verify = Requery();
echo $verify;