I'm sure someone here is intelligent enough to answer this question:
I have a form that collects a little information from a customer, then it sends him/her to Paypal to collect payment. However, I want to validate some of the info in the last form before sending them on to Paypal. The form would post to my php file, then I need to dynamically post to Paypal with PHP after validating the form. If it validates, I POST to Paypal without further adeu, but if there's a problem, I send the user back to the form to make corrections. Am I making sense?
That sounds fine. You would have two files. One HTML form and one PHP file. The hardest part, which I haven't done in a while, is "dynamically post[ing] to Paypal", but I know it can be done when you know the proper variables.. In fact, I think you can just use GET.
Thanks for the reply, but I'm still not sure how to go about doing it. What command, exactly, do I use to execute the POST? Here's what I'm trying to do:
<form method="POST" name="information" action="somefile.php">
...Get information via $_POST
all fine so far...
Post info to paypal's script (this is what I don't know how to do)
information not OK:
Send user back to the information form and correct mistakes. (this is no problem)
Understandable. Unfortunately, I don't want to write this for you as you wouldn't learn anything. I am a bit confused by the last four lines of your post.
I am not 100% sure you can even POST to paypal, I have seen URLs (using GET) to send the payment information (i.e. amount, invoice #, etc.).
As far as sending the user back to the form to correct mistakes, you can either send them back to the .html file and hope their browser cached the information they submitted, use php session's to hold the information on the validation page and have the .html (though now a .php) file where the form is located show the session's values, OR just re-create the form on the validation page where the POST variables' values are presented so they can edit the original values.
If you are interested in someone programming this for you, please post in the Offers & Requests sub-forum.
I know you can post to paypal because I currently have this form set up to post to paypal with all the variables (amount, invoice #, etc) and it is working. It looks like this: <form method="POST" name="information" action="paypal.com/cgi-bin/webscr"> What I really want; though, is for it to post to a php file where I verify the info, then send it on to the paypal file. (the paypal address above is slightly chopped off. I can't post a URL 'cause I don't have enough experience with the forum)
I simply need a little help getting me pointed in the right direction. I've looked around on php.net but I'm not sure where to start.
If I send the user back to the form for corrections, I store the original information and fill it in with the php script. That I am capable of doing. I don't need custom programming. I'm just wondering what command I might be able to use to send the information to Paypal. Give me an idea or two, and I'll take the search from there.
Sorry this is a bit confusing. I'm having trouble explaining what I need. If this is too confusing, I'll simply have to work around it some other way. Thanks.
I'm a little confused. Are you looking for help with the validating part, or are you looking for help with the Sending part? I'm sure I can help you out, I just need to know what part you need help with.
This is not a "cool solution" but a "workable one". )