RIRedinPA Posted December 9, 2009 Share Posted December 9, 2009 I'm using curl to get archived material from a web site. The way the site works is it does a search of their database through the query string (oy!) so if you send something like this http://www.notoosecureasite.com/Search/SearchResult.aspx?KW=hacking I'll get the code output for a web page showing all articles that matched that search - they are displayed with a headline, link and blurb but there is also a lot of other stuff displayed on the page. I just want to parse through this page and get the relevant stuff... The problem is right now my page is displaying their page. How do I curl this site and just get the result into a variable without displaying it? Right now it is acting as if I am using an include file. Here's the code I am using: $url = "http://nursing.advanceweb.com/Editorial/Search/SearchResult.aspx?KW=Woonsocket"; $curl_handle=curl_init(); curl_setopt($curl_handle,CURLOPT_URL,$url); $result = curl_exec($curl_handle); curl_close($curl_handle); Link to comment https://forums.phpfreaks.com/topic/184545-php-curl-question/ Share on other sites More sharing options...
JAY6390 Posted December 9, 2009 Share Posted December 9, 2009 Why not just use file_get_contents for this? $content = file_get_contents('http://nursing.advanceweb.com/Editorial/Search/SearchResult.aspx?KW=Woonsocket'); Link to comment https://forums.phpfreaks.com/topic/184545-php-curl-question/#findComment-974269 Share on other sites More sharing options...
RIRedinPA Posted December 9, 2009 Author Share Posted December 9, 2009 Why not just use file_get_contents for this? $content = file_get_contents('http://nursing.advanceweb.com/Editorial/Search/SearchResult.aspx?KW=Woonsocket'); Cause I didn't know that existed, thanks! Link to comment https://forums.phpfreaks.com/topic/184545-php-curl-question/#findComment-974280 Share on other sites More sharing options...
JAY6390 Posted December 9, 2009 Share Posted December 9, 2009 lol no problem Link to comment https://forums.phpfreaks.com/topic/184545-php-curl-question/#findComment-974281 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.