Re: [PHP] IPN error
One more thing, make sure you validate ALL data that is being sent from paypal to ensure what you need and expect are therealso validate the transaction ID to ensure it was never used before. ""Stephen Lake"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Use cURL I found it much easier then using fsockopen > > http://ca.php.net/cURL > > > ""Richard Lynch"" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> On Sat, April 29, 2006 3:53 am, suresh kumar wrote: >>> >> value="Subscribe to Additional User Account Yearly"> >> >>> my page code to process paypal >>> -- >>> >> >>> // read the post from PayPal system and add 'cmd' >>> $req = 'cmd=_notify-validate'; >>> >>> foreach ($_POST as $key => $value) { >>> $value = urlencode(stripslashes($value)); >>> $req .= "&$key=$value"; >> >> echo "$key => $value\n"; >> >>> } >>> >>> $item_name = $_POST['item_name']; >> >> $item_name = isset($_POST['item_name']) ? $_POST['item_name'] : ''; >> >> >>> Undefined index:item_name >> >> The $_POST data is not filled in, either because this is your FIRST >> visit to the page, or because something is not doing a POST request >> the way you think it should be. >> >> -- >> Like Music? >> http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IPN error
Use cURL I found it much easier then using fsockopen http://ca.php.net/cURL ""Richard Lynch"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Sat, April 29, 2006 3:53 am, suresh kumar wrote: >> > value="Subscribe to Additional User Account Yearly"> > >> my page code to process paypal >> -- >> > >> // read the post from PayPal system and add 'cmd' >> $req = 'cmd=_notify-validate'; >> >> foreach ($_POST as $key => $value) { >> $value = urlencode(stripslashes($value)); >> $req .= "&$key=$value"; > > echo "$key => $value\n"; > >> } >> >> $item_name = $_POST['item_name']; > > $item_name = isset($_POST['item_name']) ? $_POST['item_name'] : ''; > > >> Undefined index:item_name > > The $_POST data is not filled in, either because this is your FIRST > visit to the page, or because something is not doing a POST request > the way you think it should be. > > -- > Like Music? > http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IPN error
On Sat, April 29, 2006 3:53 am, suresh kumar wrote: > value="Subscribe to Additional User Account Yearly"> > my page code to process paypal > -- > > // read the post from PayPal system and add 'cmd' > $req = 'cmd=_notify-validate'; > > foreach ($_POST as $key => $value) { > $value = urlencode(stripslashes($value)); > $req .= "&$key=$value"; echo "$key => $value\n"; > } > > $item_name = $_POST['item_name']; $item_name = isset($_POST['item_name']) ? $_POST['item_name'] : ''; > Undefined index:item_name The $_POST data is not filled in, either because this is your FIRST visit to the page, or because something is not doing a POST request the way you think it should be. -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] IPN error
Hi, I am new to this IPN (instant payment notification.I am working for past 6 hours.I am using this IPN to store payment details in our database. when user clicks the paypal button in my page.it will take to paypal.com website.after user completes the payments.It will send the payment details to my page.where i can process and store in the database. This is the Code for paypal button: --- https://www.paypal.com/cgi-bin/webscr"; method="post"> https://www.paypal.com/en_US/i/btn/x-click-but20.gif"; border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!" disabled> https://www.paypal.com/en_US/i/scr/pixel.gif"; width="1" height="1"> http://myadtv.com/Gauranga/confirmation_message.php";> my page code to process paypal -- $value) { $value = urlencode(stripslashes($value)); $req .= "&$key=$value"; } // post back to PayPal system to validate $header = "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; $fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30); // assign posted variables to local variables $item_name = $_POST['item_name']; $item_number=$_POST['item_number']; $shipping_status = $_POST['no_shipping']; $note_status = $_POST['no_note']; $currency = $_POST['currency_code']; $business_name = $_POST['bn']; $payment_amount = $_POST['a3']; $payment_duration_num = $_POST['p3']; $payment_duration = $_POST['t3']; $txn_id = $_POST['txn_id']; //$receiver_email = $_POST['receiver_email']; //$payer_email = $_POST['payer_email']; $payment_status = $_POST['payment_status']; if (!$fp) { print "$errstr ($errno)\n"; } else { include('db.php'); $transactionidretrieveresult=mysql_query("select * from BillingInfo where Transaction_ID='$txn_id'"); fputs ($fp, $header . $req); while (!feof($fp)) { $res = fgets ($fp, 1024); if (strcmp ($res, "VERIFIED") == 0) { if(($payment_status=="Completed") and (!mysql_num_rows($transactionidretrieveresult))): //storing in Database; endif; } elseif (strcmp ($res, "INVALID") == 0) { print "Click The Link To Go To MyADTV Add New User Account PageClick Here"; } fclose ($fp); } ?> When i visit my page i am displaying this error Undefined index:item_name,Undefined index:item_number,Undefined index:a1,Undefined index:p1,Undefined index:t1,Undefined index:a3,and so on. I am waiting response from any one , __ Yahoo! India Matrimony: Find your partner now. Go to http://yahoo.shaadi.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php