File size: 1.33Kb
<?php
Error_Reporting(E_ALL & ~E_NOTICE);
print '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Google</title>
<style type="text/css">
body, td, tr {text-decoration: none; font-family: verdana, arial, helvetica, sans-serif; font-size: 8pt; cursor: default; color: #666;}
.mar{border-bottom:1px dotted black}
</style></head><body>';
print '
<form action="index.php" method="GET">
<input type="text" name="q" value="">
<input type="submit" name="submit" value="Искать">
</form>
<hr />';
if(empty($q)){echo"Введите запрос!";
}else{
$q=urlencode($q);
$result=file("http://www.google.ru/xhtml/search?q=$q&site=mobile&start=$start");
$respage=implode($result);
$res1=explode("<body>",$respage);
$respage=$res1[1];
$respage=str_replace("<img","<noshow",$respage);
$res=explode("<hr/>",$respage);
$respage=$res[0];
$respage=str_replace("href=\"/xhtml/search","href=\"index.php",$respage);
$respage=str_replace("<div class=\"c1\">","<div class=\"mar\">",$respage);
$respage=str_replace(" - <span class=\"c2\">","<br/><font color=\"green\">",$respage);
$respage=str_replace("</a> -","</a><br/>",$respage);
$respage=str_replace("</span>","</font>",$respage);
echo"$respage";
}
print'</body></html>';
?>