A bit about you

The $_SERVER superglobal in PHP contains a number of useful pieces of information that give an indication about the visitor; as much / most of this information is supplied by the visitor, it may be missing, it can be misleading, and it's possible for it to be falsified.

Your Browser (1)claudebot
Languages you prefer (2)-
The page you came from (3)-
Your IP address (4)54.84.65.73
The page you asked for (5)/demo/about_you.php
When you called up this page (6)1710825035


Now --- what does that mean?

(1) - HTTP_USER_AGENT => Your Browser.
This is a string of text passed from your browser to the server to tell it what type of browser is in use. As well as helping you identify the common browser types, you can identify the robots that roam the web indexing pages for search engines, and you can very often spot incursion attacks and other automata of various types too. The value is useful within the "real person" group to help you spot who is likely to have flash capabilities, who can correcly format phone: URLs, etc, so that you can adapt the page for them. See [here] and [here] and i [here].

(2) - HTTP_ACCEPT_LANGUAGE => Languages you prefer.
This will tell you the nationallity and preferred language of your visitor if (s)he has set it ... so that you can send out your response in English ... or French, Spanish, Polish or Chinese if your web site has the capability. See [here]

(3) - HTTP_REFERER => The page you came from.
This is the URL of the previous page that the user was on, or in the case of images and other files included within a page the URL of that page that called the resource up. If empty, the request is by someone typing in a URL themselves, following a link from an emal, or an automata that's indexing your site. The value is especially useful in telling you where new arrivals have come from - with a search engine, you can tell what search term the user entered that brought him to you, and with an image you can tell if it's been hotlinked from someone else's site, stealing your bandwidth and perhaps your copyright. See [here] for an example of this in use.

(4) - REMOTE_ADDR => Your IP address.
The IP address of the browser - but (be careful) this may sometimes be an intermediate proxy if the visitor is taking trouble to hide who (s)he is. More about this (and how to look it up) [here]

(5) - REQUEST_URI => The page you asked for.
The page you asked for. AT first glance, this might look pretty obvious as you'll be able to find the name of the script you're running ... but in practise it's not that starightforward. Using page redirection through mod_rewrite, you'll find you often run a piece of code held in a file who's name is different to the page name requested, and that lots of requests all map to the same script. This value lets you backtrack.

(6) - REQUEST_TIME => When you called up this page.
The time, in seconds, from 1.1.1970 that the page was called up.



Training sample © 2024, WELL HOUSE CONSULTANTS LTD
This is http://www.wellho.net/demo/about_you.php
See source code here • More examples - same topic here
Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
Phone: +44 (0) 1225 708 225 • EMAIL: info@wellho.net • WEB: http://www.wellho.net