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

how can i add a chatbox to my site?

I have two web solutions I downloaded from the internet. Jobs Portal, Classified and a forum script. Each of the scripts has its own signup and log in module. How can I make visitors register and login through one webpage without having to login in all th

How do I make sure an include file exists before loading the page?

where do i go to paste my google adsense code?

How to expire cookies when user pressed a button in webpage? I want have a link in my website then delete cookies.



Custom Search