Jump to content

Using cURL for database matching


twittoris

Recommended Posts

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.8) 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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.