PHP MySQL ebook
February 12, 2011 – 4:57 pm | No Comment

Hey everyone!!
With this section I hope to share with you resources which I have tried and valued
So you’re new to PHP and want to learn from scratch. Well I was in your position not too …

Read the full story »
SEO Tutorials

Need help with Search Engine Optimisation? This is the place to look for the latest tips and hints with the advice we offer. Keep an eye out here for the latest posts.

PHP Tutorials

Learn how to code with PHP to achieve your goal. In here I aim to show and teach you about little tips and tricks that should enhance your coding abilities

Flash Tutorials

Learn how to use Adobe Flash for your own purposes. Little tips and hints to help you along

Website Development

In here I aim to help you with developing your website from scratch. Come here for various tips and pieces of advice to help you build and improve your website.

Home » PHP Tutorials

Getting User’s IP

Submitted by on July 29, 2007 – 3:19 pmNo Comment

While looking in the PHP predefined variables i found an interesting one: $_ENV["REMOTE_ADDR"]. what this does is it gives the current IP of the person viewing your site. This is quite good if you are making a poll for a intranet where each user has their own username.

Have a look at this and tell me what you think.

PHP:
  1. $ip = $_ENV["REMOTE_ADDR"]; //set variable
  2. echo $ip; //show the value of the variable
  3. ?>

I hope somebody finds it helpful.

VN:F [1.9.13_1145]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.13_1145]
Rating: 0 (from 0 votes)

Popularity: unranked [?]

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.