Re: [PHP-DB] ip address
balwant, It seems to be working for me. I have looked at it from multiple computers, and it always gives the ip of that computer. Try for yourself: http://housing.uark.edu/resnet/ip.php Let me know if you get something other than your ip. ~Philip balwantsingh wrote: i tried the $_SERVER['REMOTE_ADDR'] it is giving ip address of server which is hosting the webpage not the user's ip address. pls. suggest how can IP address of an user can be obtained. with best wishes balwant -Original Message- From: Philip Thompson [mailto:[EMAIL PROTECTED] Sent: Thursday, September 30, 2004 3:45 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Re: getenv() alternative Oh, before I get a slew of emails about this one, I think I figured it out: $_SERVER['REMOTE_ADDR'] I knew it couldn't have been that difficult... brain fart! Sorry for wasting your time. ~Philip On Sep 29, 2004, at 5:02 PM, Philip Thompson wrote: Hi all. I am needing to obtain the IP address of a user who logs into the system. I tried to use `getenv(REMOTE_ADDR)`, however, this function does not work in ISAPI mode, which is what I am running. Is there an alternative to obtaining the IP address? I have looked around, but I cannot seem to find anything. Thanks in advance, ~Philip -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] ip address
On Thu, 30 Sep 2004 11:00:35 +0530, balwantsingh [EMAIL PROTECTED] wrote: i tried the $_SERVER['REMOTE_ADDR'] it is giving ip address of server which is hosting the webpage not the user's ip address. pls. suggest how can IP address of an user can be obtained. what exactly did you do? the following script works: === htmlbody Your IP Address is : ?php echo $_SERVER[REMOTE_ADDR]; ? /body/html === ramil http://ramil.sagum.net -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] ip address
function getIP() { if (getenv(HTTP_CLIENT_IP) strcasecmp(getenv(HTTP_CLIENT_IP), unknown)) $ip = getenv(HTTP_CLIENT_IP); else if (getenv(HTTP_X_FORWARDED_FOR) strcasecmp(getenv(HTTP_X_FORWARDED_FOR), unknown)) $ip = getenv(HTTP_X_FORWARDED_FOR); else if (getenv(REMOTE_ADDR) strcasecmp(getenv(REMOTE_ADDR), unknown)) $ip = getenv(REMOTE_ADDR); else if (isset($_SERVER['REMOTE_ADDR']) $_SERVER['REMOTE_ADDR'] strcasecmp($_SERVER['REMOTE_ADDR'], unknown)) $ip = $_SERVER['REMOTE_ADDR']; else $ip = x; // if this happens, then oh noz :-( return $ip; } -Original Message- From: Ramil Sagum [mailto:[EMAIL PROTECTED] Sent: Thursday, September 30, 2004 8:18 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] ip address On Thu, 30 Sep 2004 11:00:35 +0530, balwantsingh [EMAIL PROTECTED] wrote: i tried the $_SERVER['REMOTE_ADDR'] it is giving ip address of server which is hosting the webpage not the user's ip address. pls. suggest how can IP address of an user can be obtained. what exactly did you do? the following script works: === htmlbody Your IP Address is : ?php echo $_SERVER[REMOTE_ADDR]; ? /body/html === ramil http://ramil.sagum.net -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] ip address
Ramil, On Sep 30, 2004, at 1:17 AM, Ramil Sagum wrote: On Thu, 30 Sep 2004 11:00:35 +0530, balwantsingh [EMAIL PROTECTED] wrote: i tried the $_SERVER['REMOTE_ADDR'] it is giving ip address of server which is hosting the webpage not the user's ip address. pls. suggest how can IP address of an user can be obtained. what exactly did you do? the following script works: === htmlbody Your IP Address is : ?php echo $_SERVER[REMOTE_ADDR]; ? /body/html === ramil Yes, that's what I did (with a tad bit of error-testing), and it seems to work fine for me. ~Philip -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] ip address
i tried the $_SERVER['REMOTE_ADDR'] it is giving ip address of server which is hosting the webpage not the user's ip address. pls. suggest how can IP address of an user can be obtained. with best wishes balwant -Original Message- From: Philip Thompson [mailto:[EMAIL PROTECTED] Sent: Thursday, September 30, 2004 3:45 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Re: getenv() alternative Oh, before I get a slew of emails about this one, I think I figured it out: $_SERVER['REMOTE_ADDR'] I knew it couldn't have been that difficult... brain fart! Sorry for wasting your time. ~Philip On Sep 29, 2004, at 5:02 PM, Philip Thompson wrote: Hi all. I am needing to obtain the IP address of a user who logs into the system. I tried to use `getenv(REMOTE_ADDR)`, however, this function does not work in ISAPI mode, which is what I am running. Is there an alternative to obtaining the IP address? I have looked around, but I cannot seem to find anything. Thanks in advance, ~Philip -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] IP Address?
How can I find out the IP address of the client requesting a given php file? I know that you can use $HTTP_SERVER_VARS[REMOTE_ADDR] in more recent versions of PHP. Unfortunately, we only have PHP3.0.14 and I don't think that this option is available in our ancient version. I also can't use server side includes. An upgrade to PHP4 is in the works, but I can't wait that long. How can I get a client's IP address with PHP3.014 and/or JavaScript? Thanks in advance. -Rob -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] IP Address?
How can I find out the IP address of the client requesting a given php file? I know that you can use $HTTP_SERVER_VARS[REMOTE_ADDR] in more recent versions of PHP. Unfortunately, we only have PHP3.0.14 and I don't think that this option is available in our ancient version. I also can't use server side includes. An upgrade to PHP4 is in the works, but I can't wait that long. How can I get a client's IP address with PHP3.014 and/or JavaScript? Thanks in advance. I believe $ip = getenv('REMOTE_ADDR'); will do what you want. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] IP Address?
Thanks, Craig. That was exactly what I was looking for! -Rob -Original Message- From: Craig Vincent [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 2:35 PM To: Rob Day; [EMAIL PROTECTED] Subject: RE: [PHP-DB] IP Address? How can I find out the IP address of the client requesting a given php file? I know that you can use $HTTP_SERVER_VARS[REMOTE_ADDR] in more recent versions of PHP. Unfortunately, we only have PHP3.0.14 and I don't think that this option is available in our ancient version. I also can't use server side includes. An upgrade to PHP4 is in the works, but I can't wait that long. How can I get a client's IP address with PHP3.014 and/or JavaScript? Thanks in advance. I believe $ip = getenv('REMOTE_ADDR'); will do what you want. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] IP Address?
? phpinfo(); ? should give you all of the info you need. Sincerely berber Visit http://www.weberdev.com Today!!! To see where PHP might take you tomorrow. -Original Message- From: Rob Day [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 9:29 PM To: 'Craig Vincent'; [EMAIL PROTECTED] Subject: RE: [PHP-DB] IP Address? Thanks, Craig. That was exactly what I was looking for! -Rob -Original Message- From: Craig Vincent [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 2:35 PM To: Rob Day; [EMAIL PROTECTED] Subject: RE: [PHP-DB] IP Address? How can I find out the IP address of the client requesting a given php file? I know that you can use $HTTP_SERVER_VARS[REMOTE_ADDR] in more recent versions of PHP. Unfortunately, we only have PHP3.0.14 and I don't think that this option is available in our ancient version. I also can't use server side includes. An upgrade to PHP4 is in the works, but I can't wait that long. How can I get a client's IP address with PHP3.014 and/or JavaScript? Thanks in advance. I believe $ip = getenv('REMOTE_ADDR'); will do what you want. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] IP address datatype - any ideas or pointers?
Hi All, I'm just starting on a database to track IP addresses. I'm thinking about how best to store the IP address - 4 tinyints, varchar or char; as one big varchar or 4 chunks? We will eventually want to look at things by net or subnet and being able to search on the various parts of the address would be useful I suppose and I clearly need to spot user error like a value over 255. Is there anything out there that I might use or at least look at for ideas? Thanks Frank [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php