贝宝隐藏变量不起作用 [英] Paypal Hidden variables doesn't work

查看:49
本文介绍了贝宝隐藏变量不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能的重复:
提交 Paypal 表单时的变量

//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/thankyou.phptx=2TB90771KK039521H&st=Completed&amt=1.00&cc=PHP&cm=&item_number=11

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

我正在尝试打印 user_id,但它是空的.

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

所以我的问题是:

1) 如何将变量从我的网站发送到 paypal?(谈论 user_id)

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

2) 如何在重定向到thankyou.php 时获取那个user_id 的值?

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

感谢 ADVANCE!

Thanks in ADVANCE!

推荐答案

试试这个.当我实施 PayPal 时,它对我有用.

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

<?php

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

?>

轻微数组参数应该用引号引起来,echo 语句中不需要双引号.

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

这篇关于贝宝隐藏变量不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆