View Full Version : Resolved curl a form

10-10-2009, 01:47 AM
I want to curl a form to check the status of a messenger account how would I curl the data to the form and display the result

The site is http://www.blockstatus.com/aim/status-checker/ I used tamper data to see how it submits the postdata as you can see below


10-10-2009, 04:17 AM
ok now I got the curl part done but can't get the preg_match so it only displays offline or online

$url = "http://www.blockstatus.com/aim/status-checker/index.php";
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL,$url);

curl_setopt($ch, CURLOPT_POST, 1);

curl_setopt($ch, CURLOPT_POSTFIELDS,"aimac=screenname");

curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);

$result = curl_exec ($ch);
curl_close ($ch);

$data = $result;

$pattern = '/<b.*?>Status:(.*?)<\/b>/i';

preg_match($pattern, $data, $status);
echo "$status[0]";


and it displays:

AIM Screen Name: screenname