Curl redirect,, not working?

Posted by Sushant Panigrahi on Stack Overflow See other posts from Stack Overflow or by Sushant Panigrahi
Published on 2010-04-02T08:46:10Z Indexed on 2010/04/02 8:53 UTC
Read the original article Hit count: 344

Filed under:
|

I'm using the following code:

$agent= 'Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9) Gecko/2008052906 Firefox/3.0';    
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_URL, "www.example.com");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
$output = curl_exec($ch);
echo $output;

But it redirects to like this:

http://localhost/aide.do?sht=_aide_cookies_

Instead of to the URL page.

Can anyone help me solve my problem, please?

© Stack Overflow or respective owner

Related posts about php

Related posts about curl