Solved

Remote IP address

Posted on 1998-11-01
8
231 Views
Last Modified: 2013-12-25
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.
0
Comment
Question by:innovate
  • 5
  • 3
8 Comments
 
LVL 28

Accepted Solution

by:
sybe earned 100 total points
Comment Utility
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
 
LVL 2

Author Comment

by:innovate
Comment Utility
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
 
LVL 2

Author Comment

by:innovate
Comment Utility
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
 
LVL 28

Expert Comment

by:sybe
Comment Utility
on IIS4 you'll have to rename the file from .htm to .shtm in order to enable SSI
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 28

Expert Comment

by:sybe
Comment Utility
And I am afraid the IIS4 does not know the SSI command "echo".

0
 
LVL 28

Expert Comment

by:sybe
Comment Utility
No, In tested it with ASP, that does NOT work, but in .stm, the echo stuff works !
0
 
LVL 28

Expert Comment

by:sybe
Comment Utility
So:

Rename the file from .htm(l) to .stm(l) and the SSI code will work fine.
0
 
LVL 2

Author Comment

by:innovate
Comment Utility
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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Import csv files to MS SQL 5 60
increase words that display in widget 6 11
modify h2 4 8
remove border from element 5 9
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
The viewer will learn how to dynamically set the form action using jQuery.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now