简体   繁体   English

PHP的形式验证和贝宝

[英]php form verification and paypal

okay here is the tricky question. 好吧,这是一个棘手的问题。

I have this form and i use php (server side verification). 我有这种形式,我使用php(服务器端验证)。

Please read carefully. 请仔细阅读。

i check the form for any missing values in fields, or radio not selected, or checkbox not checked, and if success i insert the values in database. 我检查表单中字段中是否缺少任何值,或者未选中单选或未选中复选框,如果成功,我将值插入数据库中。

now till here it is okay. 现在到这里还可以。

This form is for capturing client data name and email and to get him input an extrememly important data without which his order can't be completed. 该表格用于捕获客户数据名称和电子邮件,并让他输入极其重要的数据,否则将无法完成他的订单。

Till now the form is submitted using 到现在为止,表单是使用

<input type="submit" name="submit" value="Buy Now" class="purchaseButton">

this verification part is okay, but how can they actually pay? 这个验证部分还可以,但是他们如何实际付款? I plan to add paypal button (the fix price one say $5 paypal button) 我计划添加贝宝按钮(固定价格为5美元的贝宝按钮)

now if i add paypal button the form can't be verified or if i add the verification method (which i am already using) where can i add paypal then? 现在,如果我添加贝宝按钮,则无法验证表单,或者如果我添加了验证方法(我已经在使用),那么我可以在哪里添加贝宝呢?

Shall i redirect to another page where the person see the inserted values and verifies them and pay for that? 我是否应该重定向到其他人可以看到插入值并对其进行验证并为此付费的页面? Or there is any other option (ie verification with paypal button?) 还是有其他选择(例如,使用贝宝按钮进行验证?)

I am not sure. 我不确定。 ll help will be golden friends. ll帮助将成为黄金朋友。

Thanks 谢谢

You can check if the form is submitted and display code if it is.. Add this above submit 您可以检查表单是否已提交,是否显示代码。

<input type="hidden" name="submitted" id="submitted" value="yes">

Then the php code: 然后是PHP代码:

//Check to see if the submit button has been clicked to process data
if(isset($_POST["submitted"]) && $_POST["submitted"] == "yes")
{
  //paypal code
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM