Січ 062013
 

PHP Script Информация о клиенте, пример использования $_SERVER

 
Этот пример выводит информацию находящуюся в переменной $_SERVER. Отображает информацию о сервере.
 

<?php
echo “<br>DOCUMENT_ROOT : “.$_SERVER['DOCUMENT_ROOT'];
echo “<br>GATEWAY_INTERFACE : “.$_SERVER['GATEWAY_INTERFACE'];
echo “<br>HTTP_ACCEPT : “.$_SERVER['HTTP_ACCEPT'];
echo “<br>HTTP_ACCEPT_CHARSET : “.$_SERVER['HTTP_ACCEPT_CHARSET'];
echo “<br>HTTP_ACCEPT_ENCODING : “.$_SERVER['HTTP_ACCEPT_ENCODING'];
echo “<br>HTTP_ACCEPT_LANGUAGE : “.$_SERVER['HTTP_ACCEPT_LANGUAGE'];
echo “<br>HTTP_CONNECTION : “.$_SERVER['HTTP_CONNECTION'];
echo “<br>HTTP_HOST : “.$_SERVER['HTTP_HOST'];
echo “<br>HTTP_REFERER : “.$_SERVER['HTTP_REFERER'];
echo “<br>HTTP_USER_AGENT : “.$_SERVER['HTTP_USER_AGENT'];
echo “<br>PATH_TRANSLATED : “.$_SERVER['PATH_TRANSLATED'];
echo “<br>PHP_SELF : “.$_SERVER['PHP_SELF'];
echo “<br>QUERY_STRING : “.$_SERVER['QUERY_STRING'];
echo “<br>REMOTE_ADDR : “.$_SERVER['REMOTE_ADDR'];
echo “<br>REMOTE_PORT : “.$_SERVER['REMOTE_PORT'];
echo “<br>REQUEST_METHOD : “.$_SERVER['REQUEST_METHOD'];
echo “<br>REQUEST_URI : “.$_SERVER['REQUEST_URI'];
echo “<br>SCRIPT_FILENAME : “.$_SERVER['SCRIPT_FILENAME'];
echo “<br>SCRIPT_NAME : “.$_SERVER['SCRIPT_NAME'];
echo “<br>SERVER_ADMIN : “.$_SERVER['SERVER_ADMIN'];
echo “<br>SERVER_NAME : “.$_SERVER['SERVER_NAME'];
echo “<br>SERVER_PORT : “.$_SERVER['SERVER_PORT'];
echo “<br>SERVER_PROTOCOL : “.$_SERVER['SERVER_PROTOCOL'];
echo “<br>SERVER_SIGNATURE : “.$_SERVER['SERVER_SIGNATURE'];
echo “<br>SERVER_SOFTWARE : “.$_SERVER['SERVER_SOFTWARE'];

/*
$_SERVER['DOCUMENT_ROOT'];
$_SERVER['GATEWAY_INTERFACE'];
$_SERVER['HTTP_ACCEPT'];
$_SERVER['HTTP_ACCEPT_CHARSET'];
$_SERVER['HTTP_ACCEPT_ENCODING'];
$_SERVER['HTTP_ACCEPT_LANGUAGE'];
$_SERVER['HTTP_CONNECTION'];
$_SERVER['HTTP_HOST'];
$_SERVER['HTTP_REFERER'];
$_SERVER['HTTP_USER_AGENT'];
$_SERVER['PATH_TRANSLATED'];
$_SERVER['PHP_SELF'];
$_SERVER['QUERY_STRING'];
$_SERVER['REMOTE_ADDR'];
$_SERVER['REMOTE_PORT'];
$_SERVER['REQUEST_METHOD'];
$_SERVER['REQUEST_URI'];
$_SERVER['SCRIPT_FILENAME'];
$_SERVER['SCRIPT_NAME'];
$_SERVER['SERVER_ADMIN'];
$_SERVER['SERVER_NAME'];
$_SERVER['SERVER_PORT'];
$_SERVER['SERVER_PROTOCOL'];
$_SERVER['SERVER_SIGNATURE'];
$_SERVER['SERVER_SOFTWARE'];
*/
?>

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)