I am working on an e-gold payment script for an e-gold number guess game. The function below is supposed to make an automated payment but it's not working. I'm not sure what is the problem as no error was output. Can anyone help?
The script is below:
PHP Code:
function _MakeSpend($from, $frompass, $to, $amount, $memo) { $memo = str_replace(" ","%20",$memo); $addr = "https://www.e-gold.com/acct/confirm.asp?AccountID=" . $from . "&PassPhrase=" . $frompass . "&Payee_Account=" . $to . "&Amount=". $amount ."&PAY_IN=1&WORTH_OF=Gold&Memo=". $memo . "&IGNORE_RATE_CHANGE=y&PAYMENT_ID=1"; $ch = curl_init($addr); curl_setopt($ch, CURLOPT_USERAGENT,"Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)"); curl_setopt($ch, CURLOPT_RETURNTRANSFER,0); curl_setopt($ch, CURLOPT_HEADER, 0); $fp = tmpfile(); curl_setopt ($ch, CURLOPT_FILE, $fp); $result = curl_exec($ch); curl_close($ch); fseek($fp,0,SEEK_SET); while(!feof($fp)) $result.=fread($fp,1024); fclose($fp); $result = strtolower($result); $result = strstr($result,"your batch number for confirmation is "); //I can get the batch number, but no payment was sent $result = substr($result,51,8); return $result; }
Thanks.
melissa
|