Re: Header - Post Question...
| From: | Ray Hunter | Date: | Mon, 12 May 2003 03:57:44 +0000 |
| Subject: | Re: Header - Post Question... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-147260@lists.php.net to get a copy of this message | ||
Here is what i have done in the past. I would not post to the same page
again and then use the header function...if you are only verifying user
data then use sessions to verify that data then post that data to
paypal. I am not 100% sure if you can use the header command to post
data to the next location. But i would not use the header command to do
that but rather a form for it.
--
Ray
On Sun, 2003-05-11 at 21:17, Doug Coning wrote:
> Good Day,
>
> I apoligize first of all, for I really don't know how to ask this question:
> But here goes:
>
> I am trying to connect a form to PayPal through the header command. PayPal
> requires certain variables and I have those and am not having a problem with
> that.
>
> However, PayPal requires the information sent to their website to be be sent
> via 'Post' from a form. This is where I am running into a snag. My form
> page that I'm using to gather information from the user is doing a lot of
> things. It doesn't post automatically to the PayPal site, but first posts
> to itself and then checks through all the variables to see if the user has
> entered in everything and if the user has selected a uniqure user_name,
> etc... If the user has done everything correctly, then the PHP page uses
> the following code to actually go to the PayPal site:
> header(sprintf("Location: %s", $insertGoTo)); The header command works
> nicely. However, it doesn't post any of my variables that I set dynamically
> through PHP. I like using the header command because it allows me to do
> error checking prior going to the URL, but it is not sending the variables.
>
> I have tried embedding the variables in the URL like
> paypal.com?id=me&amount=5, etc... and PayPal doesn't recognize variables in
> the URL. It looks like it only recognize it through doing a post.
>
> Now, I could create another PHP page that would be a mediator page that
> would have my form for just opening the PayPal with button and a bunch of
> hidden fields, but I prefer to have everything on one page if possible.
>
> Is there a way to use post with the header command, so that my variables get
> posted? Am I missing something?
>
> Thanks and I hope this makes sense!
>
> Blessings,
>
> Doug Coning
>
>
>