Solved

Remote IP address

Posted on 1998-11-01
8
234 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
ID: 1856062
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
ID: 1856063
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
ID: 1856064
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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 28

Expert Comment

by:sybe
ID: 1856065
on IIS4 you'll have to rename the file from .htm to .shtm in order to enable SSI
0
 
LVL 28

Expert Comment

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

0
 
LVL 28

Expert Comment

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

Expert Comment

by:sybe
ID: 1856068
So:

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

Author Comment

by:innovate
ID: 1856069
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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…

856 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