getting clients IP address with php?

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
noamkrief
-


Joined: 12 Nov 2003
Posts: 40

PostPosted: Mon Jan 12, 2004 7:15 am    Post subject: getting clients IP address with php? Reply with quote

is there a way to make an if statement depending on which IP is hitting my webserver?

I want something like this (in PHP though)

If (IP address is 192.168.0.1-192.168.0.30) {echo "hello - you are coming from my internal network";} else {"hello, you are viewing this page from the Internet";}


Is this possible?
Thanks very much
Noam
Back to top View user's profile Send private message Send e-mail
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Mon Jan 12, 2004 5:26 pm    Post subject: Re: getting clients IP address with php? Reply with quote

The IP of the client is in the variable:

Code:

$_SERVER['REMOTE_ADDR']

_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group