With PHP it's not hard to get your visitor's IP, browser and operating-system information, the page which referred him, the URL he visited and also the time when he did it. For this we make use of the following predefined variables:
- gets the visitor's IP Ex.: 192. 168. 0. 1 (localhost IP)
- the visitor's browser and operating-system information. Ex.: Mozilla/4. 0 (compatible; MSIE 6. 0; Home windows 98) Mozilla/4. 0 (compatible; MSIE 6. 0; Home windows NT 5. 0; Insane Browser 1. 0. 5;. INTERNET CLR) Mozilla/4. 0 (compatible; MSIE 5. 01; Home windows NT 5. 0) Mozilla/4. 0 (compatible; MSIE 6. 0; Home windows NT 5. 1) Mozilla/4. 0 (compatible; MSIE 6. 0; Home windows 98; Hotbar 4. four. 2. 0) Googlebot/2. 1 (+http: //www. googlebot. com/bot. html) - this means that Google crawls your site. Mozilla/4. 0 (compatible; MSIE 6. 0... - what this means is the browser is Internet explorer 6. 0 Windows NT 5. 1;... - what this means is the operating system is Microsoft Windows xp Hotbar 4. 4. two. 0 - this is really a browser extension (add-on)
- the visitor's operating-system language. Ex.: en, fr, hr, zh You can find information about language codes at http: //www. mondotimes. com/about/pop/languages. html.
- the URL this referred the visitor to the current address. Ex.: http: //www. experts-exchange. com/Programming/Programming_Languages/Cplusplus/ /prog_ttrls_by_categ. php? id=4& order=date& sort=desc& items=10& start=0 When the referer is internal (a page inside your website, the referer will appear as in the secondly example. This way you are able to track your visitors meticulously.
- the current URL the visitor has in its internet browser. Ex.: /soft_artcls_list. php /prj_proj_by_categ. php? id=3& order=date& sort=desc& items=10& start=0 / / - means the main, the main page (index. php, index. html, default. asp... ), for instance
www. geekpedia. com. This is actually the code you'll insert inside your header that is probably included in all your pages.
And this is actually the query for the data source: