<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://wbex.ru/index.php?action=history&amp;feed=atom&amp;title=PHP%2FForm%2F_SERVER</id>
		<title>PHP/Form/ SERVER - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://wbex.ru/index.php?action=history&amp;feed=atom&amp;title=PHP%2FForm%2F_SERVER"/>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=PHP/Form/_SERVER&amp;action=history"/>
		<updated>2026-04-05T10:13:27Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://wbex.ru/index.php?title=PHP/Form/_SERVER&amp;diff=664&amp;oldid=prev</id>
		<title> в 10:37, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=PHP/Form/_SERVER&amp;diff=664&amp;oldid=prev"/>
				<updated>2010-05-26T10:37:26Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 10:37, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://wbex.ru/index.php?title=PHP/Form/_SERVER&amp;diff=665&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://wbex.ru/index.php?title=PHP/Form/_SERVER&amp;diff=665&amp;oldid=prev"/>
				<updated>2010-05-26T07:04:49Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Adjusting behavior based on an environment variable==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$version = $_SERVER[&amp;quot;SITE_VERSION&amp;quot;];&lt;br /&gt;
if (&amp;quot;members&amp;quot; == $version) {&lt;br /&gt;
    if (!authenticate_user($_POST[&amp;quot;username&amp;quot;], $_POST[&amp;quot;password&amp;quot;])) {&lt;br /&gt;
        header(&amp;quot;Location: http://guest.example.ru/&amp;quot;);&lt;br /&gt;
        exit;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
include_once &amp;quot;${version}_header&amp;quot;; // load custom header&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Deciding what to do based on request method==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;?php if ($_SERVER[&amp;quot;REQUEST_METHOD&amp;quot;] == &amp;quot;GET&amp;quot;) { ?&amp;gt;&lt;br /&gt;
&amp;lt;form action=&amp;quot;&amp;lt;?php echo $_SERVER[&amp;quot;SCRIPT_NAME&amp;quot;] ?&amp;gt;&amp;quot; method=&amp;quot;post&amp;quot;&amp;gt;&lt;br /&gt;
What is your first name?&lt;br /&gt;
&amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;first_name&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Say Hello&amp;quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;?php } else {&lt;br /&gt;
    echo &amp;quot;Hello, &amp;quot; . $_POST[&amp;quot;first_name&amp;quot;] . &amp;quot;!&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Getting Times and Dates of Files: $_SERVER[&amp;quot;SCRIPT_FILENAME&amp;quot;]==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;?php &lt;br /&gt;
$lastmod = filemtime($_SERVER[&amp;quot;SCRIPT_FILENAME&amp;quot;]); &lt;br /&gt;
echo &amp;quot;file was updated on &amp;quot; . date(&amp;quot;l d F Y, \a\t H:i:s T&amp;quot;, $lastmod); &lt;br /&gt;
?&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Log use IP address==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$address = $_SERVER[&amp;quot;REMOTE_ADDR&amp;quot;];&lt;br /&gt;
$referer = $_SERVER[&amp;quot;HTTP_REFERER&amp;quot;];&lt;br /&gt;
$browser = $_SERVER[&amp;quot;HTTP_USER_AGENT&amp;quot;];&lt;br /&gt;
$file = fopen(&amp;quot;log.html&amp;quot;,  &amp;quot;a&amp;quot;);  &lt;br /&gt;
$time = date(&amp;quot;H:i dS F&amp;quot;);&lt;br /&gt;
fwrite( $file, &amp;quot;&amp;lt;b&amp;gt;Time:&amp;lt;/b&amp;gt; $time&amp;lt;br&amp;gt;&amp;quot; );&lt;br /&gt;
if( $address != null)&lt;br /&gt;
{&lt;br /&gt;
  fwrite( $file, &amp;quot;&amp;lt;b&amp;gt;IP Address:&amp;lt;/b&amp;gt; $address &amp;lt;br&amp;gt;&amp;quot;);&lt;br /&gt;
}  &lt;br /&gt;
if( $referer != null)&lt;br /&gt;
{&lt;br /&gt;
  fwrite( $file, &amp;quot;&amp;lt;b&amp;gt;Referer:&amp;lt;/b&amp;gt; $referer&amp;lt;br&amp;gt;&amp;quot;);  &lt;br /&gt;
}&lt;br /&gt;
fwrite( $file, &amp;quot;&amp;lt;b&amp;gt;Browser:&amp;lt;/b&amp;gt; $browser&amp;lt;br/&amp;gt;&amp;lt;hr&amp;gt;&amp;quot;);  &lt;br /&gt;
fclose($file);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Output file time==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  &lt;br /&gt;
  $lastmod = filemtime($_SERVER[&amp;quot;SCRIPT_FILENAME&amp;quot;]);&lt;br /&gt;
  echo &amp;quot;This file was last updated on &amp;quot;&lt;br /&gt;
        . date(&amp;quot;l d F Y, \a\t H:i:s T&amp;quot;, $lastmod)&lt;br /&gt;
        . &amp;quot;.&amp;quot;;&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==PHP $_SERVER Arguments==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Argument               Result&lt;br /&gt;
PHP_SELF               Returns the filename of the current script with the path relative to the root&lt;br /&gt;
SERVER_PROTOCOL        Returns the name and revision of the page-requested protocol&lt;br /&gt;
REQUEST_METHOD         Returns the request method used to access the page&lt;br /&gt;
REQUEST_TIME           Returns the timestamp from the beginning of the request&lt;br /&gt;
DOCUMENT_ROOT          Returns the root directory under which the current script is executing&lt;br /&gt;
HTTP_REFERER           Returns the page address that referred to the current page&lt;br /&gt;
HTTP_USER_AGENT        Returns the user agent of the header from the current request (handy for browser identification)&lt;br /&gt;
REMOTE_ADDR            Returns the IP address of the current user (handy for security)&lt;br /&gt;
REMOTE_PORT            Returns the port of the user&amp;quot;s machine that is accessing the page&lt;br /&gt;
SCRIPT_FILENAME        Returns the absolute filename from the current script&lt;br /&gt;
SCRIPT_NAME            Returns the path of the current script&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==$_SERVER extracts valuable server- and script-related information==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
PHP $_SERVER Arguments &lt;br /&gt;
Argument           Result &lt;br /&gt;
PHP_SELF           Returns the path and filename of the current script&lt;br /&gt;
SERVER_PROTOCOL    Returns the name and revision of the page-requested protocol &lt;br /&gt;
REQUEST_METHOD     Returns the request method used to access the page &lt;br /&gt;
REQUEST_TIME       Returns the timestamp from the beginning of the request &lt;br /&gt;
DOCUMENT_ROOT      Returns the root directory of the current script&lt;br /&gt;
HTTP_REFERER       Returns the page address that referred to the current page &lt;br /&gt;
HTTP_USER_AGENT    Returns the user agent of the header from the current request &lt;br /&gt;
REMOTE_ADDR        Returns the IP address of the current user &lt;br /&gt;
REMOTE_PORT        Returns the port of the user&amp;quot;s machine that is accessing the page &lt;br /&gt;
SCRIPT_FILENAME    Returns the absolute filename from the current script &lt;br /&gt;
SCRIPT_NAME        Returns the path of the current script&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Some Common $_SERVER Elements==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Variable                            Contains                           Example&lt;br /&gt;
 &lt;br /&gt;
$_SERVER[&amp;quot;PHP_SELF&amp;quot;]                The current script.                /l.php&lt;br /&gt;
 &lt;br /&gt;
$_SERVER[&amp;quot;HTTP_USER_AGENT&amp;quot;]         The name and version of the client. Mozilla/4.6 ?(X11; I;Linux2.2. 6-15apmac ppc)&lt;br /&gt;
 &lt;br /&gt;
$_SERVER[&amp;quot;REMOTE_ADDR&amp;quot;]             The IP address of the client.      192.152.55.35&lt;br /&gt;
 &lt;br /&gt;
$_SERVER[&amp;quot;REQUEST_METHOD&amp;quot;]          Whether the request was GET or POST. POST&lt;br /&gt;
 &lt;br /&gt;
$_SERVER[&amp;quot;QUERY_STRING&amp;quot;]            For GET requests, the encoded data sent appended to the URL.           name=matt&amp;amp;address=unknown&lt;br /&gt;
 &lt;br /&gt;
$_SERVER[&amp;quot;REQUEST_URI&amp;quot;]             The full address of the request, including query string.           /phpbook/source/listing10.1.php? name=matt&lt;br /&gt;
 &lt;br /&gt;
$_SERVER[&amp;quot;HTTP_REFERER&amp;quot;]            The address of the page from which the request was made.               http://p24.corrosive.co.uk/ref.html&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==superglobal variables==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;html4strict&amp;quot;&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
foreach ($_SERVER as $var =&amp;gt; $value) {&lt;br /&gt;
   echo &amp;quot;$var =&amp;gt; $value &amp;lt;br /&amp;gt;&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
  &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>