Paypal payment system php/ipn -


first english not sorry it,
i'm trying payment botton , dont understand how it
tried:

index.php

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="_blank"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value="myemail@email.com"> <input type="hidden" name="lc" value="il"> <input type="hidden" name="item_name" value="song1"> <input type="hidden" name="amount" value="0.01"> <input type="hidden" name="currency_code" value="ils"> <input type="hidden" name="button_subtype" value="services"> <input type="hidden" name="no_note" value="1"> <input type="hidden" name="no_shipping" value="1"> <input type="hidden" name="rm" value="1"> <input type="hidden" name="return" value="http://www.site.com/paypal.php"> <input type="hidden" name="cancel_return" value="http://www.site.com/index.php"> <input type="hidden" name="bn" value="pp-buynowbf:btn_buynowcc_lg.gif:nonhosted"> <input type="hidden" name="cbt" value="click here download song"> <input type="hidden" name="invoice" value="13579"> <input type="hidden" name="custom" value="<?php echo $_server["remote_addr"]; ?>"> <input type="image" src="https://www.sandbox.paypal.com/en_us/i/btn/btn_buynowcc_lg.gif" border="0" name="submit" alt="paypal - safer, easier way pay online!"> <img alt="" border="0" src="https://www.sandbox.paypal.com/en_us/i/scr/pixel.gif" width="1" height="1"> </form> 

paypal.php

<?php  // read post paypal system , add 'cmd' $req = 'cmd=_notify-validate';  foreach ($_post $key => $value) { $value = urlencode(stripslashes($value)); $req .= "&$key=$value"; }  // post paypal system 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 ('ssl://www.paypal.com', 443, $errno, $errstr, 30);  // assign posted variables 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'];  echo $payment_status." - ".$txn_id.$item_name;  ?> 

i have no idea how it, please need help
everybody


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -