-2

I need the html or java code that checks your IP. Let me put it in simple terms.

Check IP. If IP = X then run blah blah blah.

If its not possible to do this in html but it is possible. Tell me the basics because I only know so much.

Sam
  • 7,252
  • 16
  • 46
  • 65
  • you first show us what you have attempted, this is not a 'we write code for you' site. – Popo Apr 01 '14 at 01:21

1 Answers1

1

HTML does not have a way to get a user's IP, it is a markup language not a programming language.

We can't do this with JavaScript either, at least not pure JS.

PHP, however, is able to do that. In your HTML you would put

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

Note however, this value can be spoofed. See How to get the client IP address in PHP? for all the juicy details.

Community
  • 1
  • 1
geoff
  • 2,251
  • 1
  • 19
  • 34