<?php
include 'head.php';
header("Content-type:text/html; charset=utf-8");
ini_set('display_errors',0); ini_set ('register_globals', 0);
session_name('SID'); session_start();
$p = $_GET['p'];
if (empty($p)) { $p = "news/";}
$link = "http://site.ru/$p";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $link);
curl_setopt($curl,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.0.17) Gecko/2009122116 Firefox/3.0.17');
curl_setopt($curl, CURLOPT_REFERER, 'http://site.ru/'.$r);
curl_setopt($curl, CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
$code = curl_exec($curl);
curl_close($curl);
######################################################
$code = str_replace('<a href="/','<a href="?p=',$code);
$code = preg_replace('|<!DOCTYP(.*)body>|sU', '',$code);
######################################################
echo $code;
include 'foot.php';
?>
Изменил: Алексей (09.01.2012 / 13:14)