i need java script which i add in my html page when user visit that page then they see his Ip address in my page. please help me
Here you go: <script language="JavaScript"> VIH_BackColor = "palegreen"; VIH_ForeColor = "navy"; VIH_FontPix = "16"; VIH_DisplayFormat = "You are visiting from:<br>IP Address: %%IP%%<br>Host: %%HOST%%"; VIH_DisplayOnPage = "yes"; </script> <script language="JavaScript" src="http://scripts.hashemian.com/js/visitorIPHOST.js.php"></script>
the main server using php which original hosted this code if that site or host is down then it will not work for me. i hope you understand. please anybody give the proper solution
you cant access ip address of the client using javascript. you can try to use shtml if you dont have php on server. i think server side includes installed by default in apache...
I think this link is what you might be looking for. http://javascript.internet.com/user-details/ip-address.html
You can not find the IP of the user via Javascript. Javascript is client side and not server side. You will need to make an Ajax call (or have it preloaded) that get's you the IP to use in Javascript.
Or create it in the markup BEFORE pageload is done, since the code to do that client side would be a waste of time and bandwidth... and in fact would be an idiotic solution to it. No PHP you say, what idiotic halfwit hosting are you on then? Seriously... If PHP isn't available, how about ASP? SSI/SHTML? PERL? At least one of those should be available, if not your hosting is rubbish not worth paying for. Because really, this is the type of thing that has no business client-side in javascript.