Re: [PHP] How to send "post"-variables in a "Location" header

[email protected] (Matijn Woudt)
Newsgroups php.general
Message-ID <CAC_gtuPX06chA7CQoDua4r+Hi8mFb2WfPqtRm3ZTAQ8-vhSUng@mail.gmail.com>
On Mon, Aug 26, 2013 at 9:48 PM, Ajay Garg <[email protected]> wrote:

> Hi all.
>
> I have a scenario, wherein I need to do something like this ::
>
> ###############################################################
>         $original_url = "/autologin.php";
>         $username = "ajay";
>         $password = "garg";
>
>         header('Location: ' . $original_url);
> ###############################################################
>
> As can be seen, I wish to redirect to the URL "autologin.php".
>
> Additionally, I wish to pass two POST key-value pairs :: "user=ajay" and
> "password=garg" (I understand that passing GET key-value pairs is trivial).
>
> Is it  even possible?
> If yes, I will be grateful if someone could let me know how to redirect to
> a URL, passing the POST key-value pairs as necessary.
>
>
> Looking forward to a reply :)
>
>
Usually you would pass this around in sessions. If you must however use
post, you can only do so with using some javascript magic. Write a form
with hidden input and auto submit it.

- Matijn
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.