Jump to content

Recommended Posts

Posted

I am currently trying to find the PHP Code to add into my web template for the following:

 

1. Users Date

2. Users Time

3. Users IP Address

4. Users Remote IP Address

 

Any assistance would be extremly grateful. Thank you.

Posted

You can get the users remote IP address using the $_SERVER['REMOTE_ADDR'] reserved variable (see PHP's reserved variables 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'].

 

Offhand I'm not aware of a way to determine the remote browser's timezone.

Posted

Some of what you are looking for is server variables.

For example to display the visitors IP address use $_SERVER['REMOTE_ADDR']

 

<?php echo $_SERVER['REMOTE_ADDR']; ?>

 

you can see the other variables here

PHP Reference: Predefined Variables form php freaks.com

That should get you started.

Posted

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 :)

 

Thanks again :)

  • 5 months later...
Posted
...

 

Offhand I'm not aware of a way to determine the remote browser's timezone.

 

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.

Posted

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.

 

Or use IP tables to determine their location from their IP.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...