<?php
Error_Reporting(E_ALL & ~E_NOTICE);
include("header.php");
$host = "vipfon.ru";
$path = "/catalog/catalog.php?$QUERY_STRING";
$fp = fsockopen($host,80,$errno,$errstr,30);
if(!$fp) echo"$errstr ($errno)<br />\n";
else{
$headers = "GET $path HTTP/1.0\r\n";
$headers .= "Host: $host\r\n";
$headers .= "Accept: *\r\n";
$headers .="Accept-Charset: UTF-8\r\n";
$headers .= "Accept-Charset: *\r\n";
$headers .= "Accept-Encoding: deflate\r\n";
$headers .= "Accept-Language: ru\r\n";
$headers .= "User-Agent: Nokia6630/1.0\r\n\r\n";
fwrite($fp,$headers);
while($text != "\r\n")
$text = fgets($fp,128);
$text = "";
while(!feof($fp))
$text .= fgets($fp,4096);
fclose($fp);
}
header("Cache-Control: no-cache");
header("Content-Type:text/html;charset=utf-8");
$text=str_replace('<?xml version="1.0" encoding="utf-8"?>','', $text);
$text=str_replace('<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">','', $text);
$text=str_replace('<wml>','', $text);
$text=str_replace('<card title="Ftp">','', $text);
$text=str_replace('<p align="center">','', $text);
$text=str_replace('<a href="http://wapri.wapix.ru/4885/">Звуки и фразы</a><br/>','', $text);
$text=str_replace('<a href="http://erawap.net/out/?id=43">Девочки 18-19лет</a><br/>','', $text);
$text=str_replace('<a href="http://erawap.net/out/?id=43">SEX=100%Бесплатно</a><br/>','', $text);
$text=str_replace('</p>','', $text);
$text=str_replace('<p>','', $text);
$text=str_replace('Series 60','Смарт-центр', $text);
$text=str_replace('<u>Сортировать:</u> <select name="sort" value="1">','', $text);
$text=str_replace('<option value="2">Имя</option>','', $text);
$text=str_replace('<option value="3">Размер</option>','', $text);
$text=str_replace('</select>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=18&p=1&sort=$sort"/></anchor>','', $text);
$text=str_replace('<br/>','', $text);
$text=str_replace('<p align="left">','', $text);
$text=str_replace('<small>','', $text);
$text=str_replace('</small>','<br/>', $text);
$text=str_replace('<a href="index.php?c=13">Series 60</a>','<br/><a href="index.php?c=13">Series 60</a><br/>', $text);
$text=str_replace('<a href="index.php?k=2">Cофт</a>','', $text);
$text=str_replace('<a href="http://waplog.net/ru/c.shtml?10164">','', $text);
$text=str_replace('<img src="http://c.waplog.net/ru/10164.cnt" alt="waplog" /></a>','', $text);
$text=str_replace('</card>','', $text);
$text=str_replace('</wml>','', $text);
$text=str_replace('<a href="http://vipfon.ru">VipFon.ru</a>','<a href="http://lameru.net.ru">Lamerov Net</a>', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=38&p=1&sort=$sort"/></anchor>','', $text);
$text=str_replace('Всего файлов:','<br/>Всего файлов:', $text);
$text=str_replace('Всего страниц:','<br/>Всего страниц:', $text);
$text=str_replace('Текущая страница:','<br/>Текущая страница:', $text);
$text=str_replace('<a href="index.php?k=1">','<a href="games.php?k=1">', $text);
$text=str_replace('<a href="index.php?c=59">Sony Ericsson</a>','', $text);
$text=str_replace('<a href="index.php?c=54">Series60</a>','', $text);
$text=str_replace('<a href="index.php?c=116">Samsung</a>','', $text);
$text=str_replace('<a href="games.php?k=1">Игры</a>','</br><a href="games.php?k=1">Игры</a></br>', $text);
$text=str_replace('<a href="index.php?c=62">Ngage</a>','</br><a href="index.php?c=62">Ngage</a>', $text);
$text=str_replace('Номер страницы <input type="text" name="goto" format="*N" maxlength="5" value','', $text);
$text=str_replace('<anchor>Перейти<go method="get" href="catalog.php?id=38&p=$goto&sort=1"/></anchor>','', $text);
$text=str_replace('"/>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=57&p=1&sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=115&p=1&sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=63&p=1&sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=55&p=1&sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=21&p=1&sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=22&p=1&sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=20&p=1&sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=19&p=1&sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=37&p=1&sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=36&p=1&sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=35&p=1&sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=31&p=1&sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=30&p=1&sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=29&p=1&sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=165&p=1&sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=17&p=1&sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=49&p=1&sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=25&p=1&sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=24&p=1&sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=23&p=1&sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=32&p=1&sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=58&p=1&sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=117&p=1&sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=94&p=1&sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=60&p=1&sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>Перейти<go method="get" href="catalog.php?id=55&p=$goto&sort=1</anchor>','', $text);
$text=str_replace('<anchor>Перейти<go method="get" href="catalog.php?id=22&p=$goto&sort=1</anchor>','', $text);
$text=str_replace('<anchor>Перейти<go method="get" href="catalog.php?id=23&p=$goto&sort=1</anchor>','', $text);
$text=str_replace('<anchor>Перейти<go method="get" href="catalog.php?id=25&p=$goto&sort=1</anchor>','', $text);
$text=str_replace('<anchor>Перейти<go method="get" href="catalog.php?id=57&p=$goto&sort=1</anchor>','', $text);
$text=str_replace('<anchor>Перейти<go method="get" href="catalog.php?id=117&p=$goto&sort=1</anchor>','', $text);
print "$text";
include("footer.php");
?>