LinuxAnswers - the LQ Linux tutorial section.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 08-19-2003, 03:49 AM   #1
LQ Newbie
Registered: Jul 2003
Posts: 16

Rep: Reputation: 0
How Can I get Client Machine's IP in PHP

Hii All ,

I Think My problem is so simple ,though i can't solve it , becoz i don't know how to program in PHP.

well , Problem is that , My PHP script installed in a webserver ,I just want that whenever client request for that script,Script should return the IP address of client machine.In other word we can say that PHP Script should return the IP address of evey machine , where it runs.

I use getenv('REMOTE_ADDR'); function , but it returns the IP address of server instaed of Client .

well if all of you have understand my problem then help me
Thanks in advance.
Old 08-19-2003, 04:06 AM   #2
Registered: Jul 2003
Location: London
Posts: 548

Rep: Reputation: 30
I think that's what you're looking for
Old 08-19-2003, 04:08 AM   #3
Registered: Apr 2003
Location: Minde. Portugal
Distribution: DEBIAN
Posts: 87

Rep: Reputation: 15
I think you can simply use the variable $REMOTE_ADDR.
That variable's value is filled whenever there's a new connection.
Old 08-19-2003, 04:13 AM   #4
Registered: Jul 2003
Location: London
Posts: 548

Rep: Reputation: 30
he..beat you to it


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I get my machine's up time programmatically? MClayton Linux - General 2 03-11-2005 01:39 PM
i can't browse my linux machine from windows machine's network neighbourhood window yagneshmistry Linux - Networking 2 08-10-2004 03:52 AM
How to get another machine's hostname? afpe Linux - Networking 4 01-27-2003 08:59 PM
PHP: upload file to client... ugenn Programming 3 08-26-2002 11:59 AM
How can one machine access other machine's directory Wagner Linux - Networking 1 06-05-2001 08:37 AM

All times are GMT -5. The time now is 03:50 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration