LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 08-19-2003, 02:49 AM   #1
ritesh_aladdin
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, 03:06 AM   #2
andrewlkho
Member
 
Registered: Jul 2003
Location: London
Posts: 548

Rep: Reputation: 31
<?php
echo ($_SERVER['REMOTE_ADDR']);
?>
I think that's what you're looking for
 
Old 08-19-2003, 03:08 AM   #3
_kossak_
Member
 
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, 03:13 AM   #4
andrewlkho
Member
 
Registered: Jul 2003
Location: London
Posts: 548

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


Reply



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 12:39 PM
i can't browse my linux machine from windows machine's network neighbourhood window yagneshmistry Linux - Networking 2 08-10-2004 02:52 AM
How to get another machine's hostname? afpe Linux - Networking 4 01-27-2003 07:59 PM
PHP: upload file to client... ugenn Programming 3 08-26-2002 10:59 AM
How can one machine access other machine's directory Wagner Linux - Networking 1 06-05-2001 07:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:10 AM.

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