简体   繁体   中英

php form verification and paypal

okay here is the tricky question.

I have this form and i use php (server side verification).

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)

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.

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:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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