Problem with cURL, redirection and frame.
Posted: Wed Nov 10, 2010 2:40 pm
Hello guys,
I have this problem ā I want to receive results from external database search using cURL. The form action of the external page leads to .cgi file using POST method. Then redirect happens to a page on other server (HTTP/1.1 302 Moved Temporarily), which I can follow (CURLOPT_FOLLOWLOCATION) but the problem is that the new location page is created using frameset and I cannot follow frame src to receive desired data, which is displayed into one of the frames.
If I use GET method:
$cUrl = curl_init();
curl_setopt($cUrl, CURLOPT_URL,āhttp://address.com?search=whateverā);
curl_setopt($cUrl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($cUrl, CURLOPT_FOLLOWLOCATION, 1);
$pageContent = trim(curl_exec($cUrl));
curl_close($cUrl);
echo $pageContent;
then I receive desired page but with no info in it since no POST to form action script was sent.
Iām stuck on this for couple of days and I really hope someone to help me on this.
I have this problem ā I want to receive results from external database search using cURL. The form action of the external page leads to .cgi file using POST method. Then redirect happens to a page on other server (HTTP/1.1 302 Moved Temporarily), which I can follow (CURLOPT_FOLLOWLOCATION) but the problem is that the new location page is created using frameset and I cannot follow frame src to receive desired data, which is displayed into one of the frames.
If I use GET method:
$cUrl = curl_init();
curl_setopt($cUrl, CURLOPT_URL,āhttp://address.com?search=whateverā);
curl_setopt($cUrl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($cUrl, CURLOPT_FOLLOWLOCATION, 1);
$pageContent = trim(curl_exec($cUrl));
curl_close($cUrl);
echo $pageContent;
then I receive desired page but with no info in it since no POST to form action script was sent.
Iām stuck on this for couple of days and I really hope someone to help me on this.