PHP >> Visitor Stats

This little snippet can be added to show a visitors IP address. I like to use it on any protected pages and 404′s… remember, any page you use it on has to have a .php extension.

<?php echo $_SERVER['REMOTE_ADDR']; ?>

This little snippet can be added to show the page that a person was referred from. I like to use it on 404′s because the referring page is obviously pointing to the wrong spot. Remember, any page you use it on has to have a .php extension.

<?php echo $_SERVER['HTTP_REFERER']; ?>

This little snippet can be added to show what browser a person is using. Remember, any page you use it on has to have a .php extension.

<?php echo $_SERVER['HTTP_USER_AGENT']; ?>


Page Views: 53 views

Leave a Reply

icon_wink.gif icon_neutral.gif icon_mad.gif icon_twisted.gif icon_smile.gif icon_eek.gif icon_sad.gif icon_rolleyes.gif icon_razz.gif icon_redface.gif icon_surprised.gif icon_mrgreen.gif icon_lol.gif icon_idea.gif icon_biggrin.gif icon_evil.gif icon_cry.gif icon_cool.gif icon_arrow.gif icon_confused.gif icon_question.gif icon_exclaim.gif 

CommentLuv badge