HI! i have attached the code. THe oid and total are not passed on to the buyredirect page for some reason.
The code inside << >> is htmlos...there is no problem with that. But the php page is not picking up the value.
Thanks in advance.
buypage.html
<body>
<form name="buyconfirm" action="buyconf" method="post">
<table width="100%" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" border="0">
<tr><td height="50">The total purchase amt is GBP£<<totalamt>></td></tr><tr><td>
If you would like to continue click on 'BUY'</td></tr>
</td></tr><tr><td><input type="hidden" name="oid" value="<<orderid>>" ><input type="hidden" name="total" value="<<totalamt>>">
<a href="/ssl/content/buyredirect.php">BUY</a>
<a href="javascript:window.close();" class="suinput">CLOSE</a>
</td></tr></table></form></body>
buyredirect.php
<?php
#the following function performs a HTTP Post and returns the whole response
function pullpage( $host, $usepath, $postdata = "" ) {
# open socket to filehandle(epdq encryption cgi)
$fp = fsockopen( $host, 80, &$errno, &$errstr, 60 );
#check that the socket has been opened successfully
if( !$fp ) {
print "$errstr ($errno)<br>\n"; }
else {
#write the data to the encryption cgi
fputs( $fp, "POST $usepath HTTP/1.0\n");
$strlength = strlen( $postdata );
fputs( $fp, "Content-type: application/x-
);
fputs( $fp, "Content-length: ".$strlength."\n\n" );
fputs( $fp, $postdata."\n\n" );
#clear the response data
$output = "";
#read the response from the remote cgi
#while content exists, keep retrieving document in 1K chunks
while( !feof( $fp ) ) {
$output .= fgets( $fp, 1024); }
#close the socket connection
fclose( $fp); }
#Ireturn the response
return $output; }
#define the remote cgi in readiness to call pullpage function
$server="someserver";
$url="/someurl";
#the following parameters have been obtained earlier in the merchant's webstore
#clientid, passphrase, oid, currencycode, total
$params="&oid=$oid";
$params.="&total=$total";
#perform the HTTP Post
$response = pullpage( $server,$url,$params );
#split the response into separate lines
$response_lines=explode("\n",$response);
#for each line in the response check for the presence of the string ‘epdqdata’
#this line contains the encrypted string
$response_line_count=count($response_lines);
for ($i=0;$i<$response_line_count;$i++){
if (preg_match('/epdqdata/',$response_lines[$i])){
$strEPDQ=$response_lines[$i]; } }
?>
<html><head><title>SendPHP</title></head><body >
<FORM action="someurl" name="epdqphp" method="POST">
<?php print "$strEPDQ"; ?> <INPUT type="hidden" name="returnurl" value="someurl">
<INPUT type="hidden" name="merchantdisplayname" value="mystore">
<INPUT TYPE="submit" VALUE="purchase"> </FORM> </body></html>