Jump to content

Recommended Posts

I have this code so far;

<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="me@mybiz.com">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="item_name" value="product">
<input type="hidden" name="amount" value="10.00">
<input type="hidden" NAME="return" value="http://www.mybiz.com/success">
<table>
  <tr><td><input type="hidden" name="on1" value="Firstname" maxlength="50">Firstname:</td><td><input type="text" name="os1"></td></tr>
  <tr><td><input type="hidden" name="on2" value="Surname" maxlength="50">Surname:</td><td><input type="text" name="os2"></td></tr>
  <tr><td><input type="hidden" name="on3" value="Email" maxlength="200">Email:</td><td><input type="text" name="os3"></td></tr>
  <tr><td><input type="hidden" name="on4" value="Contact Number" maxlength="50">Contact Number:</td><td><input type="text" name="os4"></td></tr>
  <tr><td><input type="hidden" name="on5" value="Company Name" maxlength="50">Company Name:</td><td><input type="text" name="os5"></td></tr>
  <tr><td><input type="hidden" name="on6" value="Company URL" maxlength="200">Company URL:</td><td><input type="text" name="os6"></td></tr>
  <tr><td><input type="hidden" name="on7" value="Keywords" maxlength="200">Keywords:</td><td><input type="text" name="os7"></td></tr>
  <tr><td>Quantity:</td><td><input type="text" name="quantity" value="1" size="5" /></td></tr>
</table>
<input type="image" src="http://www.paypal.com/en_US/i/btn/x-click-but01.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>

 

I am also wanting the user to be able to upload an image.

 

Is there any certain way that I'd need to add validation to this paypal form to ensure that the information entered is accurate?

 

I also want to store the image file in a folder too (I can do that) but I just need some starters for the validation, thanks

 

Link to comment
https://forums.phpfreaks.com/topic/204281-adding-validation-to-a-paypal-button/
Share on other sites

As the form is submitted to paypal with

<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">

you should take the data you require in a step prior to the currenct form. Here you can also add your image upload. Once you have validated the data, then redirect the user to paypal.

 

1. Complete form with required fields & process image upload

2. Validate form

3. If OK send required data to paypal and redirect user

 

You can do the last bit with some hidden fields containing your data and just a continue button or something.

I'm a bit stuck at the moment, and I've not used the body onload function before.

 

What Ive decided upon is... do the initial form with validation and then pass that data to the second form. The second form simply displays what the user has entered (and cannot edit it at this point). This gives the user the chance to confirm the details that theyre going to submit. If they click confirm then it does the image upload and directs the user to paypal with all of the details, if they want to edit it they can press back and go start again.

 

How would I implement the data from the first form into the second? With sessions or will the post still field still work?

 

Also, how would I go about adding the upload function to the paypal button? thanks

How would I implement the data from the first form into the second? With sessions or will the post still field still work?

Store in session variables and the pass into the second form as hidden fields.

How would I implement the data from the first form into the second? With sessions or will the post still field still work?

The image upload is part of your first form, the second posts to paypal, not to your own server.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.