Probá así:
Código PHP:
<?php
$location = "";
$cookiearr = array();
function getPage($numero)
{
global $location;
global $cookiearr;
global $ch;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://visionweb.occourts.org/Vision_Public/SearchCase.do");
curl_setopt($ch, CURLOPT_REFERER, "");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADERFUNCTION, 'read_header');
$html = curl_exec($ch);
$matches = array();
$fields = array(
'caseNbr'=>$numero,
'lastName'=>"",
'advSearch' =>"",
'middleName'=>"",
'enterpriseName'=>"",
'dln'=>"",
'firstName'=>"",
'dob_month'=>"",
'dob_day'=>"",
'dob_year'=>"",
'action'=>"Search"
);
foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
$fields_string=substr(trim($fields_string),0,-1);
$action = "http://visionweb.occourts.org/Vision_Public/SearchCase.do";
curl_setopt($ch, CURLOPT_URL,$action);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$fields_string);
$html = curl_exec($ch);
curl_setopt($ch, CURLOPT_URL, "http://visionweb.occourts.org/Vision_Public/SearchCase.do");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$html = curl_exec($ch);
return $html;
}
function read_header($ch, $string)
{
global $location;
global $cookiearr;
global $ch;
$length = strlen($string);
if(!strncmp($string, "Location:", 9))
{
$location = trim(substr($string, 9, -1));
}
if(!strncmp($string, "Set-Cookie:", 11))
{
$cookiestr = trim(substr($string, 11, -1));
$cookie = explode(';', $cookiestr);
$cookie = explode('=', $cookie[0]);
$cookiename = trim(array_shift($cookie));
$cookiearr[$cookiename] = trim(implode('=', $cookie));
}
$cookie = "";
if(trim($string) == "")
{
foreach ($cookiearr as $key=>$value)
{
$cookie .= "$key=$value; ";
}
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
}
return $length;
}
echo getPage('06SM02800');
?>
Es más o menos lo mismo, pero tenías un nombre de campo mal colocado.