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~ Link to comment https://forums.phpfreaks.com/topic/34450-_serverremote_host/ 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] Link to comment https://forums.phpfreaks.com/topic/34450-_serverremote_host/#findComment-162233 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 :) Link to comment https://forums.phpfreaks.com/topic/34450-_serverremote_host/#findComment-162234 Share on other sites More sharing options...
DeathStar Posted January 16, 2007 Author Share Posted January 16, 2007 That did it thanks Link to comment https://forums.phpfreaks.com/topic/34450-_serverremote_host/#findComment-162262 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.