Remote IP address

How do you get a visitors IP address without using ASP.

Is there an HTML solution?

What I want to do is get the remote IP, save it in a hidden field and have the existing form submit the data to an existing script for sstorage.

If there is no HTML solution I'll be happy with a freely available CGI script.
LVL 2
innovateAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
sybeConnect With a Mentor Commented:
I don't think there is a HTML solution. As far as I know the only client-side solitions are java and ActiveX.

The easiest server-side solution is SSI (server side include) but it is not supported by alle servers.

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

So:

<input type="hidden" name="ip" value="<!--#echo var="REMOTE_ADDR"-->">

other server side solutions are CGI/ASP. They all will ask for "REMOTE_ADDR", how they do it depends a bit on the language.

==============
ASP:

<input type="hidden" name="ip" value="<%=Request.Servervariables("REMOTE_ADDR")%>">




0
 
innovateAuthor Commented:
Looks good,  I'll give it a test.  The server is IIS4 so it should work.  I'll reply in a short while with your points.
0
 
innovateAuthor Commented:
mmm? didn't work.  Tried it using a text field and it just showed

[<!--#echo var=       ]">

where the square brackets are the sides of the text box.  Client side Java would do if you have a snippet of code.

0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
sybeCommented:
on IIS4 you'll have to rename the file from .htm to .shtm in order to enable SSI
0
 
sybeCommented:
And I am afraid the IIS4 does not know the SSI command "echo".

0
 
sybeCommented:
No, In tested it with ASP, that does NOT work, but in .stm, the echo stuff works !
0
 
sybeCommented:
So:

Rename the file from .htm(l) to .stm(l) and the SSI code will work fine.
0
 
innovateAuthor Commented:
Thanks sybe.

Worked fine on my NT4 machine but when I uploaded to the web (also an NT4 machine) it just returns an empty text box.  
I've awarded the points anyway because your answer is correct.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.