Getting your Visitor's Details Using PHP

You can get quite a bit of ... nearly your visitors without having to use a third party tracking ... I'll outline the PHP commands you can use to occupy some of this data. The details yo

You can acquire quite a bit of instruction approximately your visitors without having to use a third party tracking software. I'll outline the PHP commands you can use to take control of some of this data. The details you take over can be saved into a database, and retrieved complex to check your site's bill and addict details. The later guidance is captured using the server changeable ($_SERVER) which is straightforward from PHP 4.10 onwards.Visitor's IP quarters :

You can acquire the visitor's IP habitat using the afterward command:
This will have enough money you the vistor's IP address. You can use this along later an ip to country converter database to look from which country your visitors are come in from. You can head greater than to
http://ip-to-country.webhosting.info/ for one such script.You can use PHP to resolve the ip dwelling to a domain pronounce to acquire the visitor's ISP in most cases. The ISP's domain will piece of legislation up if PHP is accomplished to resolve the IP to a proper domain. You can attain this as follows.
Note : upon some servers, using getHostByAddr to resolve domains may cause the script to slow down.Referring Page :You can commandeer the referring page, which will give you an indication of which site is sending traffic to you.
This will provide you the entire URL from which the visitor came to your site. For example if the visitor came from a google search for "i-pod", the referrer url would look something as soon as this :http://www.google.co.in/search?q=i-pod&hl=en&lr=&ie=UTF-8&start=50If you don't want the entire URL captured, but just the domain make known stored into the database, you can strip the get out of of the URL and save it to the database past so:
This will keep the referring page as :http://www.google.co.in/The page subconscious Accessed :You can afterward occupy the page innate accessed upon your server. This
information will back up you investigate which parts of your site is getting more page views.A more advocate user can afterward use this counsel to make a
click-stream of the user. A click-stream is the passage that a user
follows even though he goes through your site. This lets you see how
on the go your site's navigation is.
If the visitor is accessing your page,
http://www.yourdomain.com/guestbook.php, the requested page would be 'guestbook.php'.These pieces of guidance will urge on you construct a visitor tracker in PHP, which will be accomplished to tell you quite a bit virtually your visitors and how they use your site.

Related Posts

Post a Comment

Subscribe Our Newsletter