twittoris Posted September 3, 2010 Share Posted September 3, 2010 I have a list of companies I have to look up information for on the entity search page for the state. here is what i have so far except there seems to be a verification error. Anyone know how to fix this so the page will display results? <?php // INIT CURL $ch = curl_init(); // SET URL FOR THE POST FORM LOGIN curl_setopt($ch, CURLOPT_URL, 'http://appext9.dos.state.ny.us/corp_public/CORPSEARCH.SELECT_ENTITY'); // ENABLE HTTP POST curl_setopt ($ch, CURLOPT_POST, 1); //set curl options curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2. Gecko/20100722 Firefox/3.6.8 ( .NET CLR 3.5.30729)"); curl_setopt($ch, CURLOPT_REFERER, "http://www.google.com/"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_COOKIEJAR, 'CURLCOOKIE'); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0); //visit page to get cookies //$strGet_page_contents = curl_exec ($ch); // SET POST PARAMETERS : FORM VALUES FOR EACH FIELD curl_setopt ($ch, CURLOPT_POSTFIELDS, 'p_entity_name=Apple LLC&p_name_type=Arwen&p_search_type=BEGINS&submit=Search!'); // EXECUTE $store = curl_exec ($ch); echo curl_exec ($ch); // CLOSE CURL curl_close ($ch); ?> Link to comment https://forums.phpfreaks.com/topic/212466-using-curl-for-database-matching/ Share on other sites More sharing options...
twittoris Posted September 3, 2010 Author Share Posted September 3, 2010 Its a public database and there is a 500 search result limit. i think it has to do with the robot file. Link to comment https://forums.phpfreaks.com/topic/212466-using-curl-for-database-matching/#findComment-1106961 Share on other sites More sharing options...
twittoris Posted September 3, 2010 Author Share Posted September 3, 2010 Never mind I fixed it. Link to comment https://forums.phpfreaks.com/topic/212466-using-curl-for-database-matching/#findComment-1106968 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.