сделал все как вы писали.
ошибка
Illegal use of $_SERVER. You must use the request class or request_var() to access input data. Found in /home/motobrat/public_html/crop/conf.php on line 32. This error message was generated by deactivated_super_global.
BACKTRACE
FILE: (not given by php)
LINE: (not given by php)
на всякий случай привожу полный код файла.
Код: Выделить всё
<?php
define("DOCROOT", $_SERVER["DOCUMENT_ROOT"].DIRECTORY_SEPARATOR);
// charset
header("Content-type: text/html; charset=UTF-8");
// session
session_start();
include 'classes/Upload.php';
include 'classes/Crop.php';
define('IN_PHPBB', TRUE);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include $phpbb_root_path.'common.'.$phpEx;
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
if ($user->data['user_id'] == ANONYMOUS)
{
login_box(request_var('redirect', request_url()));
}
function request_url($get_path = false, $clear = false)
{
global $config, $user;
$server_name = $user->host;
$server_port = (!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT');
// Forcing server vars is the only way to specify/override the protocol
if ($config['force_server_vars'] || !$server_name)
{
$server_protocol = ($config['server_protocol']) ? $config['server_protocol'] : (($config['cookie_secure']) ? 'https://' : 'http://');
$server_name = $config['server_name'];
$server_port = (int) $config['server_port'];
$url = $server_protocol . $server_name;
$cookie_secure = $config['cookie_secure'];
}
else
{
// Do not rely on cookie_secure, users seem to think that it means a secured cookie instead of an encrypted connection
$cookie_secure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 1 : 0;
$url = (($cookie_secure) ? 'https://' : 'http://') . $server_name;
}
if ($server_port && (($cookie_secure && $server_port <> 443) || (!$cookie_secure && $server_port <> 80)))
{
// HTTP HOST can carry a port number (we fetch $user->host, but for old versions this may be true)
if (strpos($server_name, ':') === false)
{
$url .= ':' . $server_port;
}
}
// Strip / from the end
//if (substr($url, -1, 1) == '/')
//{
// $url = substr($url, 0, -1);
//}
if (isset($_SERVER['REQUEST_URI']))
{
$url .= $_SERVER['REQUEST_URI'];
}
else if (isset($_SERVER['argv']))
{
$url .= $_SERVER['SCRIPT_NAME'] .'?'. $_SERVER['argv'][0];
}
else if (isset($_SERVER['QUERY_STRING']))
{
$url .= $_SERVER['SCRIPT_NAME'] .'?'. $_SERVER['QUERY_STRING'];
}
else
{
$url .= $_SERVER['SCRIPT_NAME'];
}
if ($get_path)
{
$url_delim = (strpos($url, '?') === false) ? '?' : ((strpos($url, '?') === strlen($url) - 1) ? '' : '&');
if($clear)
{
$url_delim = array($url_delim . $get_path, '&' . $get_path, '?' . $get_path, $get_path);
$url = str_replace($url_delim, "", $url);
}
else
{
$url .= $url_delim . $get_path;
}
}
return $url;
}?>