Просмотр файла catalog.php

Размер файла: 7.44Kb
<?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&amp;p=1&amp;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&amp;p=1&amp;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&amp;p=$goto&amp;sort=1"/></anchor>','', $text);
$text=str_replace('"/>','', $text);

$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=57&amp;p=1&amp;sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=115&amp;p=1&amp;sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=63&amp;p=1&amp;sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=55&amp;p=1&amp;sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=21&amp;p=1&amp;sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=22&amp;p=1&amp;sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=20&amp;p=1&amp;sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=19&amp;p=1&amp;sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=37&amp;p=1&amp;sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=36&amp;p=1&amp;sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=35&amp;p=1&amp;sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=31&amp;p=1&amp;sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=30&amp;p=1&amp;sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=29&amp;p=1&amp;sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=165&amp;p=1&amp;sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=17&amp;p=1&amp;sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=49&amp;p=1&amp;sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=25&amp;p=1&amp;sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=24&amp;p=1&amp;sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=23&amp;p=1&amp;sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=32&amp;p=1&amp;sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=58&amp;p=1&amp;sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=117&amp;p=1&amp;sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=94&amp;p=1&amp;sort=$sort</anchor>','', $text);
$text=str_replace('<anchor>ОК<go method="get" href="catalog.php?id=60&amp;p=1&amp;sort=$sort</anchor>','', $text);

$text=str_replace('<anchor>Перейти<go method="get" href="catalog.php?id=55&amp;p=$goto&amp;sort=1</anchor>','', $text);
$text=str_replace('<anchor>Перейти<go method="get" href="catalog.php?id=22&amp;p=$goto&amp;sort=1</anchor>','', $text);
$text=str_replace('<anchor>Перейти<go method="get" href="catalog.php?id=23&amp;p=$goto&amp;sort=1</anchor>','', $text);
$text=str_replace('<anchor>Перейти<go method="get" href="catalog.php?id=25&amp;p=$goto&amp;sort=1</anchor>','', $text);
$text=str_replace('<anchor>Перейти<go method="get" href="catalog.php?id=57&amp;p=$goto&amp;sort=1</anchor>','', $text);
$text=str_replace('<anchor>Перейти<go method="get" href="catalog.php?id=117&amp;p=$goto&amp;sort=1</anchor>','', $text);

print "$text";
include("footer.php");
?>