IP Address

M

MRBEATZ

I'm new to this group on here, but I wanted to know if anyone knows how to
display an IP address using javascript. Thanks in advance.

Randy
 
R

Randy Webb

MRBEATZ said:
I'm new to this group on here, but I wanted to know if anyone knows how to
display an IP address using javascript. Thanks in advance.

No. JS has no way of determining the IP Address so it has no way to
display it, on its own.
 
R

Randy Webb

Richard said:

That site does not use JS to get the IP Address, only to display it. It
relies on server side scripting to attempt to get the IP Address. Before
attempting to correct me in the future, try actually reading (and
understanding) what I said. You do know though that they have a *reason*
for calling you RtS?
Actually, it sneaks in a simple line of php coding to do it.

Actually, its not PHP, but it is a server side scripting language.
PHP code does not start:
<!--#echo var="REMOTE_ADDR"-->

PHP tags either start with <? or <?PHP
I have seen some total javascripts do the trick.

No you haven't. But you are welcome to *attempt* to prove me wrong.
Question is will they actually detect the true IP of the visitor's machine
or not?

Doesn't matter since IP addresses are as worthless as the hairs on a
chicken's ass.
To better trap the IP would be best done server side with php.

And if a user does not have PHP available? Hmmmm
 
E

Evertjan.

MRBEATZ wrote on 06 mrt 2005 in comp.lang.javascript:
I'm new to this group on here, but I wanted to know if anyone knows
how to display an IP address using javascript. Thanks in advance.

document.write("123.456.1.1");

Is it about displaying "an" IP or
about determining what your own IP is?

The server often sees another IP adres [router, proxi],
than your browser uses.

Serverside asp example using clientside javascript to display:

document.write("<%=request.servervariables("remote_addr")%>");

With pure clientside javascript it is impossible, I believe.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top