ClioSport.net

Register a free account today to become a member!
Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

  • When you purchase through links on our site, we may earn an affiliate commission. Read more here.

php help



  172ph2
Hi folks, can anyone tell me if I'm heading in the right direction or not?

I'm starting to put together part of a site where the customer enters their Ref#, then clicks 'pay' and triggers some php to look in a mysql database for how much they owe, then this value needs to get put into <input type="hidden" name="amount" value="XX.XX"> and sent to the paypal checkout.

I was thinking if I have "payabill.html" with a text entry box, could I use that to call something like "/records.php?custrefnum" and have the .php file forward on the necessary info to paypal...?
 
Sounds about the right way of doing things. Does your website make the customer login first? You could make it with sessions if so.
 
  172ph2
Nope, no logins, they just enter their ref#, hit pay and it takes them to the paypal payment screen with the amount they owe.

doesn't sound too hard to do but i've only literally been doing php for a few hours so far and sessions sounds a bit advanced at the mo
 
  Toyota MR2 GT Turbo
You don't need PHP for that, just set your form to GET instead of POST and make the action PayPal.
When you submit a form with GET it puts the values in the url like you said above:

/records.php?custrefnum=45346&amount=34.66

Just name your fields correctly and make the action "records.php" and it will look like that.

PayPal is a down right hoebag to work with from my experience.

So I think in your case you will have to use POST and use a PHP script to redirect you.
Get a developer account and read some tutorials and play around with the sandbox API.
 


Top