<?php
require_once"../template/start.php";
require_once"../template/regglobals.php";
require_once"../template/config.php";
require_once"../template/functions.php";
require_once"../template/antidos.php";
require_once"../template/cookies.php";
require_once"../template/gzip.php";
require_once"../template/header.php";
require_once"../template/referer.php";
include_once"../themes/$config_themes/index.php";
include_once"../template/isset.php";

echo '<img src="../images/img/partners.gif" alt=""> <b>WAP-Поиск</b><br><br>';

if (isset($_GET['q'])){$q=$_GET['q'];}else{$q='';}
if (isset($_GET['start'])){$start=$_GET['start'];}else{$start='';}
if (isset($_GET['filter'])){$filter=$_GET['filter'];}else{$filter='';}
if(empty($q)){echo"Введите слово для поиска!";
}
else
{
$se=urlencode($q);
$result=file("http://www.google.ru/xhtml/search?q=$se&site=mobile&start=$start&filter=$filter");
$respage=implode($result);
$res1=explode("<body>",$respage);
$respage=$res1[1];
$respage=str_replace("<img","<noshow",$respage);
$res=explode("<form",$respage);
$res12=explode("<hr/>",$res[0]);
$respage=$res12[0];
$respage=str_replace("&nbsp;","<br />",$respage);
$respage=str_replace("href=\"/xhtml/search","href=\"index.php",$respage);
$respage=str_replace("<div class=\"c1\">","<hr /><div class=\"a\">",$respage);
$respage=str_replace("<span class=\"c2\">","<font color=\"yellow\">",$respage);
$respage=str_replace("</span>","</font>",$respage);
echo"$respage";
}
echo "<form action=\"index.php\" method=\"GET\"><br>";
echo "<input type=\"text\" name=\"q\" value=\"$q\"><br>";
echo "<input type=\"submit\" name=\"submit\" value=\"Искать\"><br>";
echo "</form>";
echo '<img src="../images/img/homepage.gif" alt=""> <a href="../index.php?'.SID.'">На главную</a>';
include_once"../themes/$config_themes/foot.php";
?>