blizzardofozz Posted November 10, 2010 Share Posted November 10, 2010 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 https://forums.phpfreaks.com/topic/218322-problem-with-curl-redirection-and-frame/ Share on other sites More sharing options...
requinix Posted November 10, 2010 Share Posted November 10, 2010 Not terribly automation-friendly. Is there an API you can use instead? Are you page scraping something you shouldn't? You could always do a regular expression on the frame source and a second cURL request. Depends what the HTML looks like... Link to comment https://forums.phpfreaks.com/topic/218322-problem-with-curl-redirection-and-frame/#findComment-1132773 Share on other sites More sharing options...
blizzardofozz Posted November 10, 2010 Author Share Posted November 10, 2010 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 https://forums.phpfreaks.com/topic/218322-problem-with-curl-redirection-and-frame/#findComment-1132775 Share on other sites More sharing options...
requinix Posted November 11, 2010 Share Posted November 11, 2010 Wait, so, is this address.com yours as well? Link to comment https://forums.phpfreaks.com/topic/218322-problem-with-curl-redirection-and-frame/#findComment-1132839 Share on other sites More sharing options...
blizzardofozz Posted November 11, 2010 Author Share Posted November 11, 2010 It is not mine. It is not the real www.address.com, let say it’s example.com Link to comment https://forums.phpfreaks.com/topic/218322-problem-with-curl-redirection-and-frame/#findComment-1132911 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.