0

Looking for a simple script I can install on a password protected page that basically detects and display the viewers IP address. So that when my client logs on the page to review a design mock up --I want a pop up dialog that displays his IP address to HIM, with maybe a message "Thank you. This IP Address Was Recorded" and an "OK" button to close the dialog box.

This way he's aware (or under the impression) his visit was "recorded".

Nice to have would be if it were actually recorded for me as well, maybe via an email message or in an IP log/time of visit text file (although that seems like it might be getting in over my head code wise)

The ABSOLUTE ULTIMATE solution would be also if I got notified real time when he accesses the password protected page.

Marc
  • 115
  • 4
  • So what have you tried? – Isaac Vidrine Jan 14 '19 at 21:59
  • You want to do this on the client or server? You have this tagged `javascript`, which suggests you mean on the client, unless you're using `node.js` on the server. – Barmar Jan 14 '19 at 22:01
  • But you also say that you're recording the IP, which suggest it's on the server. – Barmar Jan 14 '19 at 22:01
  • In PHP you use `$_SERVER['REMOTE_ADDR']`. There should be something equivalent whatever language you're using on your server. – Barmar Jan 14 '19 at 22:03
  • https://stackoverflow.com/questions/391979/how-to-get-clients-ip-address-using-javascript – Navid Yousefzai Jan 14 '19 at 22:04
  • Sorry.. I'm not that good at coding... I can bang out html and some css but that's about it. I tried this http://www.javascriptkit.com/script/script2/displayip.shtml but it didn't work. I was hoping for something I could copy paste into my HTML and be done. Looking into "The free IP2Location demo" from ip2location.com – Marc Jan 14 '19 at 22:05
  • Note that you can't really trust an IP address that's submitted by the client, since the user can alter it before it's sent. You should just use the IP that the server library reports. – Barmar Jan 14 '19 at 22:07
  • This is simply for a client's page reviewing some artwork... to be used once or twice but to give HIM the impression his visit was recorded. Thereby hoping reducing any ideas of stealing my design. I guess this site is really all about the code pros. Sorry for my dumb novice question. I'll figure something out. Thanks Guys – Marc Jan 14 '19 at 22:09
  • Even though this question was dismissed it was NOT answered. The link given (answer) shows ways to recorded IP adresses. It does NOT show me a manner in which their ip address pops up for the viewer to see in a pop up window --with an "OK" button to close it. Thanks anyways.. but you really shouldn't just dismissed people when the question was not really answered. – Marc Jan 14 '19 at 22:16
  • The easiest way is make a request to https://api.myip.com on the page and the returned object displays the IP; all client side. – Ilan P Jan 15 '19 at 02:54

0 Answers0