Problem with cURL, redirection and frame.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
blizzardofozz
Forum Newbie
Posts: 3
Joined: Wed Nov 10, 2010 2:37 pm

Problem with cURL, redirection and frame.

Post by blizzardofozz »

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.
Post Reply