PHP Questions Home | Register | Login
Categories
Arrays
Files
Forms
Creating PDFs
PHP Errors
Functions
Images
MySQL
Numbers
Others
Strings
Website
Unanswered

PHP Forums
Forums Index
MySQL Forum
PHP Forum
Flash/Actionscript
Javascript
Web design

More PHP
PHP Functions
Top Questions
Ask a Question
PHP Interview Questions
PHP Jobs
Ecommerce
IT Questions
Business Websites

Sponsors

sponsor ad
My Salary
PHP Developer Salary
Advertise Here

How do I find a visitors IP address?


A common requirement is to be able to log or store the IP address of a visitor to your website.

In order to do this, you can easily access the IP address through an environment variable.

The one that you want for the IP Address is called $REMOTE_ADDR, so you can access it like this:

<?php
$ip 
$REMOTE_ADDR;
echo 
"Your IP address is $ip";
?>



Comment on this Question and Answer >>>

ASK A QUESTION

More website PHP Questions

What is this form of code for a website? http://www.virginamerica.com/va/home.do the drop down menu's. whats the name for that. im trying to incorporate it into my design, but dont no the name for it.

I have uploaded a vbforum which is al coded in php. and i also have a php.ini file. i turned the display_errors off. so now whern i try to go to the site i see a blank page. And everything is correctly coded because i didn't change anything. But it works

my web site www.innovativephp.com is not configured properly to dns how can i do that?

How to find a domain name for an IP address?

How can I access information sent through POST on a form?



Custom Search