ok I took some of the code yuo put in the txt file and his stings are old or somthing I got it working here try this code in a test.php or somthing page and run it
<?
if ($_REQUEST["Submit"] == "Search") {
$reg = '/<li><p><big><a href=\"http:\/\/.*?\*(.*?)\">(.*?)<\/a><\/big> - (.*?)<br>/i';
$page = join("", file("http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=".$_REQUEST["search"]."&btnG=Google+Search"));
$page = ereg_replace("\n", "", $page);
preg_match_all($reg, $page, $matches);
echo $page;
$cnt = count($matches[0]);
for($x=0;$x<$cnt;$x++){
$url = $matches[1][$x];
$title = $matches[2][$x];
$descr = $matches[3][$x];
$title = strip_tags($title);
$descr = strip_tags($descr);
if (stristr($title, "search within this site")) $title = "";
$extrastuff = "";
if ($cacheentry=="1" && $title){
$sql = "select * from $table where url='".$url."'";
$result = mysql_query($sql);
$numrows = mysql_fetch_row($result);
if ($numrows==0){
$slashtitle = addslashes($title);
$slashdescr = addslashes($descr);
$sql = "insert into $table values('', '".$url."', '".$slashtitle."', '".$slashdescr."', '0', now())";
$result = mysql_query($sql);
$extrastuff = "[Added to ".$engtitle."]";
}
}
if ($newwin=="1") $targetwin = " target='_$url'";
if ($title) print "<tr><td bgcolor='$color1'> <a href='$url'$targetwin><b><font face='$fontface' size='$fontsize'>$title</font></b></a><font face='$fontface' size='$fontsize'> <font color='#000000'>$extrastuff</font></font></td></tr><tr> <td bgcolor='$color2'><blockquote><p><font face='$fontface' size='$fontsize' color='$textcolor'>$descr</font></p></blockquote></td></tr>";
}
//print "<tr><td bgcolor='$color1'> <a href='$url'$targetwin><b><font face='$fontface' size='$fontsize'>$title</font></b></a><font face='$fontface' size='$fontsize'> <font color='#000000'>$extrastuff</font></font></td></tr><tr> <td bgcolor='$color2'><blockquote><p><font face='$fontface' size='$fontsize' color='$textcolor'>$descr</font></p></blockquote></td></tr>";
return;
}
?>
<form name="search" method="post" action="<? $PHP_SELF; ?>">
<table width="740" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>Search
<input name="search" type="text" id="search" size="60">
<input type="submit" name="Submit" value="Search"></td>
</tr>
</table></form>