| View previous topic :: View next topic   | 
	
	
	
		| Author | 
		Message | 
	
	
		noamkrief -
 
  Joined: 12 Nov 2003 Posts: 40
 
  | 
		
			
				 Posted: Mon Jan 12, 2004 7:15 am    Post subject: getting clients IP address with php? | 
				      | 
			 
			
				
  | 
			 
			
				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 | 
		
			           | 
		
	
	
		  | 
	
	
		aprelium -
 
  Joined: 22 Mar 2002 Posts: 6800
 
  | 
		
			
				 Posted: Mon Jan 12, 2004 5:26 pm    Post subject: Re: getting clients IP address with php? | 
				      | 
			 
			
				
  | 
			 
			
				The IP of the client is in the variable:
 
 
 	  | Code: | 	 		  
 
$_SERVER['REMOTE_ADDR']
 
 | 	 
  _________________ Support Team
 
Aprelium - http://www.aprelium.com | 
			 
		  | 
	
	
		| Back to top | 
		
			           | 
		
	
	
		  | 
	
	
		 |