Re: Is it possible to send POST vars through a header redirect?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 3, 2009 at 2:54 PM, Jim Lucas <lists@xxxxxxxxx> wrote:

> TS wrote:
> > I'm trying to send vars via POST somehow. Is this possible?
> >
> > Currently I'm doing
> >
> > header("Location: http://domain/index.php?var=3";);
> >
> > but, want to send POST or some other method that doesn't stick with the
> session.
> >
> > Thanks, T
> >
> >
>
> No, it is not possible.  You will need to look into cURL or something else.
>
> But it cannot be done via the header() function.
>

I second that you need to use curl:

$header = array(
            "MIME-Version"=>"1.0",
            "Content-type"=>"text/html; charset=utf-8"
        );
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $this->elqPosturl);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_TIMEOUT, $this->curlOptTimeOut);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
        curl_setopt($ch, CURLOPT_PROXY, $this->proxyServer);
        curl_setopt($ch, CURLOPT_PROXYPORT, $this->proxyPort);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $inputArray);
        curl_setopt($ch, CURLOPT_USERAGENT, 'MSIE');
        curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
        curl_setopt($ch, CURLOPT_HEADER, 1);

        $data = curl_exec($ch);

Thanks,
V

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux