...

View Full Version : Resolved curl a form



The_Return
10-10-2009, 12: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

POSTDATA=aimac=screenname&submit=Submit

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



<?php
$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
Status:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum