In other words;
When someone Submits "Script #1",
I'd like "Script #2" to be executed before "Script #1",
is sent to "Paypal".
I'm thinking it could be done using "Code #1" or "Code #2",
before "Script #2".
What I need to know is, how to make this possible?
Script #1: (PayPal Script)
Code: Select all
echo "<form target='paypal' action='https://www.paypal.com/cgi-bin/webscr' method='post'>\n";
echo "<input type='hidden' name='cmd' value='_cart'>\n";
....
echo "<input type='submit' name='submit' value='Purchase This Item'>\n";Script #2: (Log Script)
Code: Select all
{
$logfile = "logfile.txt";
$logthis = $row->item_num.$row->item_name." FOR $".$row->Price."+ $".$row->shipping." TOTALING $".$row->total_price;
$fh = fopen($logfile, "a");
fwrite ($fh, "$logthis\n");
fclose ($fh);
}Code: Select all
if (isset($_POST['submit']))Code: Select all
if ($submit)I was thinking I might have to change "action=" to <? PHP_SELF ?>, but if I do,
I don't know how to submit the data to 'https://www.paypal.com/cgi-bin/webscr'.
Could anyone give me any pointers, or help shed some light on this project?
btw, I'm using my ISP's PHP/4.2.3 on Apache/1.3.27 and mySQL db.
I'M LOOKING FOR ANY PHP PROGRAMMER TO HELP ME WITH THE CODES ABOVE,
I DO NOT WANT TO RECODE MY WHOLE SCRIPT OR USE PayPal's IPN.