DeathStar Posted January 16, 2007 Share Posted January 16, 2007 Trying to display the ip and host from users when the login.when i try:[code]$host = $_SERVER['REMOTE_HOST'] ;$ip = $_SERVER['REMOTE_ADDR'] ;[/code]only the Ip adrress comes up and the host not?!? ???Does anyone know why?~DeathStar~ Quote Link to comment Share on other sites More sharing options...
taith Posted January 16, 2007 Share Posted January 16, 2007 that doesnt work for some isp's, this will :-)[code]<?function get_host(){ if(!$_SERVER[REMOTE_HOST]) return gethostbyaddr($_SERVER[REMOTE_ADDR]); else return $_SERVER[REMOTE_HOST];}?>[/code] Quote Link to comment Share on other sites More sharing options...
Caesar Posted January 16, 2007 Share Posted January 16, 2007 This should do the trick:[code]<?php$ip = $_SERVER['REMOTE_ADDR'];$host = gethostbyaddr($_SERVER['REMOTE_ADDR']);?>[/code]Lemme know if that works for ya :) Quote Link to comment Share on other sites More sharing options...
DeathStar Posted January 16, 2007 Author Share Posted January 16, 2007 That did it thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.