Jump to content

Problem with cURL, redirection and frame.


blizzardofozz

Recommended Posts

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.

 

Link to comment
Share on other sites

I guess there is no problem to use this form since it’s free to use and doesn’t requires registration. Just want to use it on other site and I will contribute the source. There is nothing hidden there.

 

“You could always do a regular expression on the frame source and a second cURL request.”

You mean to cURL the string $pageContent? How to do that?

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.