<?php
$wer=$_SERVER['QUERY_STRING'];
$url='http://m.images.yandex.ru/';
error_reporting(0);

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_REFERER, 'http://yandex.ru');
curl_setopt($curl, CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
$cnt = curl_exec($curl);
curl_close($curl);

$cnt=str_replace('"search"','"find.php"',$cnt);
$cnt=str_replace('"search?','"find.php?',$cnt);

$cnt=preg_replace('/<!(.*?)<\/table>/si','',$cnt);
$cnt=preg_replace('/<div class="b\-foot">(.*?)<\/html>/si','',$cnt);
$cnt=str_replace('height="48"','height = "48" style="border:1px #ff0000 solid;margin:1px"',$cnt);
$cnt=str_replace('<th><input id="find.php"','<th style="width:100%"><input class="inp" id="find.php"',$cnt);
//$cnt=preg_replace('/<div class="b\-popular">(.*?)<\/div>/si','',$cnt);

$cnt=str_replace("&amp;nbsp;",'&nbsp;',$cnt);
$cnt=preg_replace('/<table(.*?)>/si','',$cnt);
$cnt=preg_replace('/<td(.*?)>/si','',$cnt);
$cnt=preg_replace('/<th(.*?)>/si','',$cnt);
$cnt=str_replace('</table>','',$cnt);
$cnt=str_replace('</td>','',$cnt);
$cnt=str_replace('<tr>','',$cnt);
$cnt=str_replace('</tr>','',$cnt);
$cnt=str_replace('</th>','',$cnt);
include ("set.php");
$cnt=str_replace('Популярные картинки:','<div class="'.$div_razd.'">
Актуальные:
</div>',$cnt);
$cnt=str_replace('<input type="submit"','<div></div><input class="submit" type="submit"',$cnt);
include ("head.php");
echo '<div class="'.$div_razd.'"><a href="'.$site.'">['.$copy.']</a>[Картинки]</div><div class="'.$div_body.'">';
echo($cnt);
echo '</div>';
include ("foot.php");
exit();
?>
