开发者

Paypal Hidden variables doesn't work [duplicate]

This question already has an answer here: Closed 11 years ago.

Possible Duplicate:

Variables upon submitting Paypal form

//Buy.php
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
    <input type="hidden" name="cmd" value="_xclick">
    <input type="hidden" name="hosted_button_id" value="EWE57TOG6A1GO">
    <input type="hidden" name="user_id" value="12345">
    <input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
</form>

After the successful payment. You'll be redirected to

www.thankyou.com/thankyo开发者_JAVA技巧u.phptx=2TB90771KK039521H&st=Completed&amt=1.00&cc=PHP&cm=&item_number=11

//Thankyou.php
<?php
    extract($_REQUEST);
    echo $user_id;
?>

I am trying to print the user_id but it is empty.

So my Question is:

1) How can I send variable from my site to paypal? (talking about the user_id)

2) How to get the value of that user_id when redirected to thankyou.php?

Thanks in ADVANCE!


Try this. It worked for me when I implemented PayPal.

<?php

    $user_id = $_REQUEST['user_id'];    
    echo $user_id;    

?>

Slight edit: The array parameter should be in quotes and the double quotes are unnecessary in the echo statement.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜