curl-and-php
Problem with redirection
Date: Mon, 17 Dec 2007 16:34:49 +0100
Hi
I greet you all and i am a new member of this mailing list.
I would like to use the curl library. I wish to get a content from a page
(page x: http://www.travelan.net/module/20316/more-gesamt/).
For that i call a page (page y: http://www.getyourstock.com/alfa13.php) and
this page calls page x (see the example alfa13.php).
Now the problem is following: There is an redirection whitin page x and i do
not know how to get the content of the redirected page x
The content of the redirected page x should be displayed finally in the
browser.
Result: I only get the header, but not the content of the page itselfs.
The header i get is following:
HTTP/1.1 302 Found Date: Mon, 17 Dec 2007 15:20:17 GMT Server: Apache/2.0.54
(Debian GNU/Linux) PHP/5.2.3 with Suhosin-Patch DAV/2 mod_ssl/2.0.54
OpenSSL/0.9.7e X-Powered-By: PHP/5.2.3 Set-Cookie:
PHPSESSID=1vmqk1rfjgau42pvki54kl8je5; path=/ Expires: Thu, 19 Nov 1981
08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate,
post-check=0, pre-check=0 Pragma: no-cache location:
http://www.holidayandmore.de/index.asp?Agentur=50376&AgentID=20316
Transfer-Encoding: chunked Content-Type: text/html
You can see the content of the redirected page x under:
http://www.holidayandmore.de/index.asp?Agentur=50376&AgentID=20316
But, how i say, i will not get this content!
Additional information of my provider:
- curl support: enabled
- libcurl/7.16.1 OpenSSL/0.9.7e zlib/1.2.3
I tried with several curl_setopt() options, but withour success!
Do i use wrong options? Is this not possible what i like to do?
Can anybody help me?
Thanks a lot in advance
Joedi
***** Example: http://www.getyourstock.com/alfa13.php ******
<?php
$url = "http://www.travelan.net/module/20316/more-gesamt/";
$referer = "http://www.getyourstock.com/";
$ch = curl_init();
curl_setopt ($ch, CURLOPT_REFERER, $referer);
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_HEADER, 1);
curl_setopt ($ch,CURLOPT_AUTOREFERER,true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_exec ($ch);
curl_close ($ch);
?>
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2007-12-17