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 access information sent through POST on a form?

Explain why the meaning people have of health may contrast with the meanings other people may hold.

Help : how to automatically upload files every 5 minutes ? Hi , Can anybody help me with this php code : I want to read the file names from a folder ( word document files or media files with extentions) and enter the url of the files in mysql d

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

how to get gmail inboxmessages in php using username and password



Custom Search