Extra Block Types (EBT) - New Layout Builder experience❗

Extra Block Types (EBT) - styled, customizable block types: Slideshows, Tabs, Cards, Accordions and many others. Built-in settings for background, DOM Box, javascript plugins. Experience the future of layout building today.

Demo EBT modules Download EBT modules

❗Extra Paragraph Types (EPT) - New Paragraphs experience

Extra Paragraph Types (EPT) - analogical paragraph based set of modules.

Demo EPT modules Download EPT modules

Scroll

подмена адреса php

подмена адреса php
, by

 

 

 

 

как заставить обработчик думать что текущая страница не site.ru/n.php?n=fil.jpg а site.ru/public/file.jpg ?


header('Cache-control: max-age=2592000');
header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T',time()+2592000));
$chunk=20480; // bytes
@set_time_limit(0);
@ignore_user_abort(true);
@set_magic_quotes_runtime(0);
require_once'includes/db.class.php';
require_once'includes/functions_mime.inc.php';
require_once'includes/configs.inc.php';
require_once'includes/mysql.class.php';
function out($f){header('Content-type: image/gif');@readfile($f);exit;}
$fid=isset($_GET['fid'])?abs((int)$_GET['fid']):0;
$D=new DB;if(!$D->open(PUBLIC_SETTINGS))exit('E200');$S=$D->all();$D->close();unset($D);
extract($UPL['MYSQL'],EXTR_OVERWRITE);
$M=new mysqlDB($host,$username,$password,$database,0);
$M->query("SELECT * FROM uploader_pfiles WHERE file_id={$fid} LIMIT 1;");
if($M->getRowCount())
{
$r=$M->getAssoc();$M->free();
if(($S['max_views']&&$r['file_views']>=$S['max_views']) || ($S['max_bandwidth']&&($r['file_views']*$r['file_size']/1048576)>=$S['max_bandwidth']))
{
$M->query("DELETE FROM uploader_pfiles WHERE file_id={$fid};");
@unlink($S['public_files_dir'].$r['file_rname']);
$M->query("SELECT COUNT(file_id) AS c FROM uploader_pfiles WHERE upload_id={$r['upload_id']};");
if($M->getRowCount()){$c=$M->getAssoc();if(!$c['c'])$M->query("DELETE FROM uploader_puploads WHERE upload_id={$r['upload_id']};");}
out('data/public_file_removed.gif');
}
header('Content-type:'.mime_type($r['file_rname']));header('Content-disposition: filename="'.$r['file_name'].'";');
if(false===($fp=fopen($S['public_files_dir'].$r['file_rname'],'rb')))exit('E100');
do{$buf=fread($fp,$chunk);print$buf;}while(!feof($fp));
$M->query("UPDATE uploader_pfiles SET file_views=file_views+1 WHERE file_id={$fid};");
}
else out('data/public_file_removed.gif');

 

 

 

 

 

 

 

1 answer
votes: 820
Answer

Я так понимаю вам нужен mod_rewrite, здесь написано как им пользоваться:

http://biohazardo.ru/php%D1%81%D0%BE%D0%B7%D0%B4%D0%B0%D0%B5%D0%BC-%D1%81%D0%B2%D0%BE%D0%B9-%D1%84%D1%80%D0%B5%D0%B9%D0%BC%D0%B2%D0%BE%D1%80%D0%BA-%D1%80%D0%BE%D1%83%D1%82%D0%B5%D1%80%D0%B0-%D0%B8-%D0%BE%D0%B1%D1%80/