PDA

View Full Version : IP address showing



Anayet
June 30th, 2001, 12:17
How can I edit my webpage so that if a person comes on it, there IP address will be shown to them on the same page??

Thanks
Anayet

Neverm1nd
June 30th, 2001, 13:51
<script>
<!--
// ############################################################ #########################################
// ## Please do NOT change this Copyright. I worked LONG and HARD (over a year) on this script ALONE. ##
// Copyright 1998 Jon Eyrick - action1@vfr.net
// http://www.geocities.com/CapeCanaveral/4155/
// ############################################################ #########################################
warn="NOW DIDN'T I TELL YOU NOT TO MESS WITH MY COPYRIGHT?";
var author="Jon Eyrick";
var x=" ";
var t="y";
var a="E";
var u="r";
var w="o";
var b="J";
var s="k";
var z='n';
var q="c";
var g="i";

function alrt(){
alert(''+warn+'');
}

if (author == b+w+z+x+a+t+u+g+q+s){
javascript="cool";
window.onerror=null;
myAddress=java.net.InetAddress.getLocalHost();
myAddress2=java.net.InetAddress.getLocalHost();
host=myAddress.getHostName();
ip=myAddress2.getHostAddress();
}
else{
alrt();alrt();alrt();alrt();alrt();alrt();alrt();alrt();alrt ();alrt();alrt();alrt();alrt();alrt();alrt();alrt();alrt();a lrt();alrt();alrt();alrt();alrt();alrt();alrt();alrt();alrt( );alrt();alrt();alrt();alrt();alrt();alrt();alrt();alrt();al rt();alrt();alrt();alrt();alrt();alrt();alrt();alrt();alrt() ;alrt();alrt();alrt();alrt();alrt();alrt();alrt();alrt();alr t();alrt();alrt();alrt();alrt();alrt();alrt();alrt();alrt(); alrt();alrt();alrt();alrt();alrt();alrt();alrt();alrt();alrt ();alrt();alrt();alrt();alrt();alrt();alrt();alrt();alrt();a lrt();alrt();alrt();alrt();alrt();alrt();alrt();alrt();alrt( );alrt();alrt();alrt();alrt();alrt();alrt();
}

document.write("Your host name is "+host);
document.write("<BR>Your IP address is "+ip);
//-->
</script>


dunno if it works with IE... with opera it doesn't... the javascript source seems a bit strange to me... but I didn't write it :p

good luck & grtz,
Nevermind

polestar
June 30th, 2001, 15:43
Very amusing neverm1nd.......

This only works with Netscape, so it's fairly useless. I don't know if it can be altered for IE.


<SCRIPT LANGUAGE="JavaScript">
<!-- Begin

if ((navigator.appVersion.indexOf("4.") != -1) && (navigator.appName.indexOf("Netscape") != -1)){
ip = "" + java.net.InetAddress.getLocalHost().getHostAddress();
document.write("Your IP address is " + ip);
}
else {
document.write("IP Address only shown in Netscape with Java enabled!");
}
// End -->
</script>

Good luck!!!

Neverm1nd
June 30th, 2001, 15:45
amusing? hmm... I already thought the code looked a bit strange :rolleyes: but I didn't make it... only tried to help :p

puDDs
June 30th, 2001, 15:53
Forget all the copywrite crap in there, just use this, it will save some resources:



<script>
var localhost, host, ip
window.onerror=null;

localhost=java.net.InetAddress.getLocalHost();
host=localhost.getHostName();
ip=localhost.getHostAddress();

document.write("Your hostname is:" + host)
document.write("<br>")
document.write("Your IP address is:" + ip)

</script>


However, this will only work in Netscape!

If you want a cross-browser solution, you'll have to use ASP, PHP or Perl.

Edit: Or SSI, that will work too.

puDDs
June 30th, 2001, 15:55
// ## Please do NOT change this Copyright. I worked LONG and HARD (over a year) on this script ALONE. ##


Over a year on that?

Neverm1nd
June 30th, 2001, 15:58
LOL :D
guess someone has a f*cked up life and an intelligence level like a monkey (or something :rolleyes: )

keith
June 30th, 2001, 22:30
using ssi or php, it's only one short line of code.


ssi:
<!--#echo var="REMOTE_ADDR" -->


php:
<? echo("$REMOTE_ADDR"); ?>

atlas
July 1st, 2001, 00:34
Originally posted by Neverm1nd
LOL :D
guess someone has a f*cked up life and an intelligence level like a monkey (or something :rolleyes: )

Judging how the copyright is "enforced" I'd have to agree :)

lucifer
July 1st, 2001, 06:34
maybe they just spent the year on the anti-copyright-removal - some people are crazy

polestar
July 1st, 2001, 14:03
Originally posted by keith
using ssi or php, it's only one short line of code.

ssi:
<!--#echo var="REMOTE_ADDR" -->

php:
<? echo("$REMOTE_ADDR"); ?>

*kneeling down* We are not worthy!

What a great answer! You are da man.

Talk about intelligence level like a monkey (not naming any names "mr eyrick" :D) - you must have a really high ICQ (or something).

bigperm
July 1st, 2001, 14:22
var author="Jon Eyrick";
var x=" ";
var t="y";
var a="E";
var u="r";
var w="o";
var b="J";
var s="k";
var z='n';
var q="c";
var g="i";

function alrt(){
alert(''+warn+'');
}

if (author == b+w+z+x+a+t+u+g+q+s){
javascript="cool";

So, if he is the author... the script is 'cool'? Egotistical javascript... that's new.

keith
July 1st, 2001, 14:44
Originally posted by polestar


*kneeling down* We are not worthy!

What a great answer! You are da man.

Talk about intelligence level like a monkey (not naming any names "mr eyrick" :D) - you must have a really high ICQ (or something).

what the hell? i don't know if you're actually praising me or sarcastically mocking me, i know i wasn't arrogant about anything, just gave a pretty simple answer. ah well... they work, that's all that matters.

oh yeah, php and ssi are server side languages, so they'll work regardless of the browser, whether the user has javascript enabled or not.

meow
July 2nd, 2001, 00:07
Did you check the copyright guy's site? "Go to my NS4.0 Enhanced Page Requires NS 4.0". He hasn't been around for awhile. :p

If your IP is showing you ought to zip up. This could be indecent exposure. I'm considering to call the vice squad. :eek:

polestar
July 2nd, 2001, 08:42
[quote]what the hell? i don't know if you're actually praising me or sarcastically mocking me[quote] :o The former.

You went straight to the point and gave the best answer to the question.

LastActionHero
July 3rd, 2001, 10:22
Originally posted by keith
using ssi or php, it's only one short line of code.


ssi:
<!--#echo var="REMOTE_ADDR" -->


php:
<? echo("$REMOTE_ADDR"); ?>

Uhh won't work with f2s . For some reason f2s servers always give the remote address as localhost(127.0.0.1)

gyrbo
July 3rd, 2001, 11:11
True, you need to use REMOTE_X_HOST or something like that.

LastActionHero
July 4th, 2001, 01:18
Originally posted by gyrbo
True, you need to use REMOTE_X_HOST or something like that.

something like this?
php:
<? echo("$REMOTE_X_HOST"); ?>

icanttype
July 4th, 2001, 18:19
Try <?php echo($HTTP_X_FORWARDED_FOR); ?>

There's a lot of usefull stuff you can pick up if you do <? phpinfo(); ?> btw.

Koolguy
July 5th, 2001, 22:20
Yet on his site he says he supports copyright infrigement... lol

Not to mention this line "This page is best viewed with a computer and a monitor."

That was cool back in '94 :p

LastActionHero
July 5th, 2001, 23:19
Originally posted by Koolguy
Yet on his site he says he supports copyright infrigement... lol

Not to mention this line "This page is best viewed with a computer and a monitor."

That was cool back in '94 :p

huh? :confused: