Paypal不想吃变量 [英] Paypal doesnt want to eat the variable

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

问题描述

我有这些文件是通过paypal以基于用户选择的dinamic价格开始交易的。

I have these files that are made to start a transaction via paypal with a dinamic price based on the user choices.

 <script language="javascript">
       submitForms = function(){
       document.getElementById("paypal2_form").submit();
       document.getElementById("paypal_form").submit();
     }

</script>
<form class="paypal" action="payments.php" method="post" id="paypal2_form" target="_blank">
    <input type="text" name="amount" value=""/>
    <input type="button" value="Click Me!" onclick="submitForms()" />
</form>
<form class="paypal" action="payments.php" method="post" id="paypal_form" target="_blank">
    <input type="hidden" name="cmd" value="_xclick" />
    <input type="hidden" name="no_note" value="1" />
    <input type="hidden" name="lc" value="UK" />
    <input type="hidden" name="currency_code" value="GBP" />
    <input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynow_LG.gif:NonHostedGuest" />
    <input type="hidden" name="first_name" value="Customer's First Name"  />
    <input type="hidden" name="last_name" value="Customer's Last Name"  />
    <input type="hidden" name="payer_email" value="customer@example.com"  />
    <input type="hidden" name="item_number" value="123456" / >
</form>



这是php。




And this is the php.

 // Database variables
$host = "localhost"; //database location
$user = "root"; //database username
$pass = ""; //database password
$db_name = "payments"; //database name
$paypal_email = 'myemail';
$return_url = 'return page.org';
$cancel_url = 'cancel page.org';
$notify_url = 'notify page.org';

$xd = $_POST['amount'];

$item_name = 'Test Item';
$item_amount = 10;
...



事情就是$ item_aamount,如果我把确切的值它会起作用但是如果我使用变量来自它将在paypal窗口上插入值的形式的值。我在html页面上插入数据库中的值并在此php上询问它但我不知道该放什么transaction_id,字段我不知道它来自哪里。



(在html页面上我有一个脚本,提交2个表单,其中一个值与paypal的东西一起,它是一个文本输入因为它是一个让paypal从变量中获取该混蛋价值的测试。



如果有更好的方法来做它而不是这个我打开.Thx in提前



我尝试了什么:



我已经尝试过数据库中的值,然后在另一页上获取值


The thing is that $item_aamount, if I put the exact value it will work but if i use the variable with the value that comes from the form it will ask on the paypal window to insert the value.I tought on the html page insert the value on the database and ask for it on this php but i dont know what to put the transaction_id , field i dont know where it comes from.

(On the html page i have a script that submits the 2 forms one with the value other with the paypal things , its a text input because its a test to make the paypal eat the goddam value from the variable).

If there is a better way to do it rather than this im open.Thx in advance

What I have tried:

I already tried to put the value in a database and get the go get the value on the other page

推荐答案

host =localhost; //数据库位置
host = "localhost"; //database location


user =root; //数据库用户名
user = "root"; //database username


pass =; //数据库密码
pass = ""; //database password


这篇关于Paypal不想吃变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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