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