| View previous topic :: View next topic   | 
	
	
	
		| Author | 
		Message | 
	
	
		John Guest
 
 
 
 
 
  | 
		
			
				 Posted: Sun Jun 16, 2002 7:23 am    Post subject: Retrive client's ip address | 
				      | 
			 
			
				
  | 
			 
			
				My script is:
 
 
<?
 
$host = gethostbyaddr($REMOTE_ADDR);
 
 
print "Your host name is $host ($REMOTE_ADDR).";
 
?>
 
 
but when I run the script I get this:
 
 
Notice: Undefined variable: REMOTE_ADDR in E:\Abyss Web Server\htdocs\test.php on line 11
 
 
Notice: Undefined variable: REMOTE_ADDR in E:\Abyss Web Server\htdocs\test.php on line 13
 
Your host name is John (). 
 
 
 
Please help me, thanks | 
			 
		  | 
	
	
		| Back to top | 
		
			        | 
		
	
	
		  | 
	
	
		TheLinker -
 
  Joined: 05 Apr 2002 Posts: 165 Location: Oslo, Norway
  | 
		
			
				 Posted: Sun Jun 16, 2002 7:31 am    Post subject:  | 
				      | 
			 
			
				
  | 
			 
			
				| Use $_SERVER["REMOTE_ADDR"]. | 
			 
		  | 
	
	
		| Back to top | 
		
			           | 
		
	
	
		  | 
	
	
		 |