Php Codes

liunx

Guest
I am currently trying to find the PHP Code to add into my web template for the following:<br /><br />1. Users Date<br />2. Users Time<br />3. Users IP Address<br />4. Users Remote IP Address<br /><br />Any assistance would be extremly grateful. Thank you.<!--content-->
I would suggest searching hotscripts or google for the above. <br /><br />JimE<!--content-->
You can get the users remote IP address using the $_SERVER['REMOTE_ADDR'] reserved variable (see PHP's <a href="http://www.php.net/reserved.variables" target="_blank">reserved variables</a> for more details). I'm not sure what the difference is you are referring to between "Users IP Address" and "Users Remote IP Address". If you are referring to the server address for one of them, that can be determined by $_SERVER['SERVER_ADDR'].<br /><br />Offhand I'm not aware of a way to determine the remote browser's timezone.<!--content-->
Some of what you are looking for is server variables.<br />For example to display the visitors IP address use $_SERVER['REMOTE_ADDR']<br /><br /><?php echo $_SERVER['REMOTE_ADDR']; ?><br /><br />you can see the other variables here<br />PHP Reference: Predefined Variables form <a href="http://www.phpfreaks.com/PHP_Reference/Predefined-Variables/8.php" target="_blank">php freaks.com</a><br />That should get you started.<!--content-->
Great thank you very much for you help guys. I have now found what I am looking for and have it just about set up and ready for release <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><br /><br />Thanks again <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--content-->
<!--quoteo(post=189691:date=Sep 8 2006, 01:05 PM:name=TCH-MikeJ)--><div class='quotetop'>QUOTE(TCH-MikeJ @ Sep 8 2006, 01:05 PM) <a href="http://www.totalchoicehosting.com/forums/index.php?act=findpost&pid=189691"><img src='http://www.totalchoicehosting.com/forums/style_images/1/post_snapback.gif' alt='*' border='0' /></a></div><div class='quotemain'><!--quotec-->...<br /><br />Offhand I'm not aware of a way to determine the remote browser's timezone.<!--QuoteEnd--></div><!--QuoteEEnd--><br /><br />I was looking around for tips on timezones for another reason...and it struck me to comment on this if this issue ever comes to someones mind again... Maybe it would be possible to collect the remote browser's timestamp and put it into a cookie...then read the cookie on the server.<!--content-->
The only way to detect their timezone would be to use javascript to get their computers time and then compare it with the servers time and calculate the difference.<br /><br />Or use IP tables to determine their location from their IP.<!--content-->
 
Top