Просмотр поста

.
Rakovskiy
The Fast, Secure and Professional - Yii2
# kiberpank (01.06.2014 / 12:14)
Rakovskiy, понял ... а как сделать чтобы контент можно было скачивать?
а то при нажатии скачать тока шапку и ноги сайта выводит
Держи,проверь

define('_IN_JOHNCMS', 1);
$textl = 'test';
require_once('../incfiles/core.php');
require_once('../incfiles/head.php');
$ch = curl_init ();
curl_setopt ($ch , CURLOPT_URL , "http://iceload.ru/films/" . $act);
curl_setopt ($ch , CURLOPT_USERAGENT , "Mozilla/5.0 (Windows; U; Windows NT 6.1; ru-RU; rv:1.7.12) Gecko/20050919 Firefox/1.0.7"); //типа мы делаем это из мозиллы
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
$content = curl_exec($ch); //Записываем награбленное в $content
curl_close($ch);
iconv("windows-1251","utf-8", $content);
$content = str_replace('<?xml version="1.0" encoding="utf-8"?>',' ',$content);
$content = preg_replace('#<head>(.*)</head>#sU','',$content);
$content = preg_replace('#<!DOCTYPE(.*)<div class="title">(.*)</div>#sU','',$content);
$content = preg_replace('#<div class="main">(.*)</div>#sU','',$content);
$content = preg_replace('#<sсript>(.*)</sсript>#sU','',$content);
$content = preg_replace('#<div class="foot">(.*)</div>#sU','',$content);
$content = str_replace('<a href="http://iceload.ru/films/info','<a href="?act=info',$content);
echo $content;
require_once('../incfiles/end.php');