Visitor's IP tutorial
- Added: Nov 9th, 2005
- Level: Easy
- Author: Melfina
- Reads: 4753
- Description: Show your visitor's IP with just two lines of php code.
This is more a copy-paste code than a real tutorial, but hey, anyways:
<?php $visitorip = $_SERVER['REMOTE_ADDR'];
echo "$visitorip"; ?>
echo "$visitorip"; ?>
What we do with this, is request the visitor's ip and assign it a name, visitorip, then we output it with an echo. Paste the code where you want the ip to show. Of course, before and after the code (or you can include it), you can give it format and add anything you want, just don't touch the code between < and > if you don't know how php works. Want an example? sure!
Your IP is 38.103.63.17
If you like this tutorial why not
digg it or
add to del.icio.us? You can also comment this tutorial or ask for help on
its forum topic.
Tutorial © Melfina. Do not reproduce in any way without previous permission from the author.
Bookmark
E-mail to a friend
View printable version



