id like to be able to query a search engine and return a variable that tells me the position of a query.
eg
this could tells me whether it exists, but id like to push it a little further and to tell me where exactly.
<?
$query = $words;
$pattern = $domain;
$url="http://www.google.com/search?q=$query";
if(!($fp=fopen($url, "r")))
{
exit;
}
$contents = fread($fp, 1000000);
fclose($fp);
$contents = eregi($pattern, $contents, $result);
if($result){
echo"$result[0]";
}
else{
echo"not found";
}
?>
2 things
Why wont it work with google (works when i query yahoo http://search.yahoo.com/search?p=$query )
can anyone help me determine the position of the queried term
tia
for any help