• Link us
  • Links
  • TOS
  • Site
  • Gallery
  • Forum
Subscribe

Visitor's IP - PHP & MySQL tutorial

Tutorials > PHP & MySQL tutorials > Visitor's IP
  • Added: Nov 9th, 2005
  • Level: Easy
  • Author: Melfina
  • Reads: 11,657
  • Description: Show your visitor's IP with just two lines of php code.
Bookmark Digg del.icio.us

E-mail to a friend

View printable version


This is more a copy-paste code than a real tutorial, but hey, anyways:

<?php $visitorip = $_SERVER['REMOTE_ADDR'];
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 216.73.216.114


If you like this tutorial why not digg it or add to del.icio.us?

Tutorial © Melfina. Do not reproduce in any way without previous permission from the author.

  • Members login
  • Register for free

Web layouts

  • Web layouts
  • Aardvark Topsites skins
  • SMF Themes
  • Wordpress Themes

Graphic resources

  • 100x100 Avatars
  • PS and PSP brushes
  • Brush shop
  • Background patterns
  • Web icons and smilies
  • Textures
  • Renders (PNG)

Tutorials

  • Newest tutorials
  • Adobe Photoshop
  • CSS
  • Designs / Layouts
  • HTML & XHTML
  • Miscellaneous
  • Paint Shop Pro
  • PHP & MySQL

Affiliates

  • Ego Box
  • The Jaded Network

Partners

Celestial Star © Melfina 2003-2010. By using this site you agree to our terms of service
Layout credits: Hybrid Genesis, Bittbox, swe3ty
Valid XHTML | Valid CSS | Top of the page