note 69821 added to tutorial.whatsnext

From: Date: Fri, 22 Sep 2006 07:44:09 +0000
Subject: note 69821 added to tutorial.whatsnext
Groups: php.notes 
Request: Send a blank email to php-notes+get-117410@lists.php.net to get a copy of this message
Let us do something more useful now. We are going to check what sort of browser the visitor is using. For that, we check the user agent string the browser sends as part of the HTTP request. This information is stored in a variable. Variables always start with a dollar-sign in PHP. The variable we are interested in right now is $_SERVER['HTTP_USER_AGENT']. Note: $_SERVER is a special reserved PHP variable that contains all web server information. It is known as an autoglobal (or superglobal). See the related manual page on superglobals for more information. These special variables were introduced in PHP 4.1.0. Before this time, we used the older $HTTP_*_VARS arrays instead, such as $HTTP_SERVER_VARS. Although deprecated, these older variables still exist. (See also the note on old code.) To display this variable, you can simply do: ---- Server IP: 203.199.124.111 Probable Submitter: 202.83.62.198 ---- Manual Page -- http://www.php.net/manual/en/tutorial.whatsnext.php Edit -- https://master.php.net/note/edit/69821 Del: integrated -- https://master.php.net/note/delete/69821/integrated Del: useless -- https://master.php.net/note/delete/69821/useless Del: bad code -- https://master.php.net/note/delete/69821/bad+code Del: spam -- https://master.php.net/note/delete/69821/spam Del: non-english -- https://master.php.net/note/delete/69821/non-english Del: in docs -- https://master.php.net/note/delete/69821/in+docs Del: other reasons-- https://master.php.net/note/delete/69821 Reject -- https://master.php.net/note/reject/69821 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#117410) next »