Jump to content

Display visitors' IP Address on site


Guest flying_dragon

Recommended Posts

Guest flying_dragon

Hi All, First of all I would like to say sorry if I'm posting on a wrong forum, u c, Im working on my website, and i was wondering is there a (an html script or maybe javascript?) way to display user's ip when they are visiting my website?? :) can anyone help me? i also want to display today's date in my website? is it possible? thanks in advance guys..

Link to comment
Share on other sites

For date and time you could use a javascript (it will display the date/time from users machine): http://www.w3schools.com/js/js_obj_date.aspI don't think javascript can access the user IP, you would have to use a ssl lik php or asp.asp: <% Response.Write(Request.ServerVariables("remote_addr"))%>php: <?php echo "User's IP address: " . $_SERVER["REMOTE_ADDR"]; ?>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...