pxlcreations
03-11-2010, 11:54 PM
Hey all. I am currently using a PayPal IPN script let me give a small background on how 2 parts work. One part takes paypal variables and populates them into the script. It does so by this:
// assign posted variables to local variables
$item_name = $_POST['item_name'];
$item_number = $_POST['item_number'];
$payment_status = $_POST['payment_status'];
$payment_amount = $_POST['mc_gross'];
$payment_currency = $_POST['mc_currency'];
$txn_id = $_POST['txn_id'];
$receiver_email = $_POST['receiver_email'];
$payer_email = $_POST['payer_email'];
$custom = $_POST['custom'];
$payment_date = $_POST['payment_date'];
$invoice = $_POST['invoice'];
I also have to use paypal variables for this. There's a list here:
https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_html_Appx_websitestandard_htmlvariables
Okay, onto the help part. I have my IPN script send the user's email address to a text file which I store my mailing list data in. It does so by this:
$File = "..//mailer/data/email.txt";
$Handle = fopen($File, 'a');
$MyData = "\"". $payer_email . "\"" . "," . "\"" . $invoice . "\"" . "," . "\"" . $custom . "\"" . "\r\n";
fwrite($Handle, $MyData);
fclose($Handle);
Basically, I want the user to check a checkbox, and it runs that part of the script. If not, it doesn't. This allows the user to choose to subscribe or not. So I need an if function and I need to somehow see if the checkbox is checked in the IPN script. Here's my form code:
<input type="checkbox" name="os0" value="yes" checked>
Thanks! If you need more information, I can try and assist.
// assign posted variables to local variables
$item_name = $_POST['item_name'];
$item_number = $_POST['item_number'];
$payment_status = $_POST['payment_status'];
$payment_amount = $_POST['mc_gross'];
$payment_currency = $_POST['mc_currency'];
$txn_id = $_POST['txn_id'];
$receiver_email = $_POST['receiver_email'];
$payer_email = $_POST['payer_email'];
$custom = $_POST['custom'];
$payment_date = $_POST['payment_date'];
$invoice = $_POST['invoice'];
I also have to use paypal variables for this. There's a list here:
https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_html_Appx_websitestandard_htmlvariables
Okay, onto the help part. I have my IPN script send the user's email address to a text file which I store my mailing list data in. It does so by this:
$File = "..//mailer/data/email.txt";
$Handle = fopen($File, 'a');
$MyData = "\"". $payer_email . "\"" . "," . "\"" . $invoice . "\"" . "," . "\"" . $custom . "\"" . "\r\n";
fwrite($Handle, $MyData);
fclose($Handle);
Basically, I want the user to check a checkbox, and it runs that part of the script. If not, it doesn't. This allows the user to choose to subscribe or not. So I need an if function and I need to somehow see if the checkbox is checked in the IPN script. Here's my form code:
<input type="checkbox" name="os0" value="yes" checked>
Thanks! If you need more information, I can try and assist.