Thank you for your reply.
The web page is on a server that supports SSI so when one views the source
code of the page when viewing it with a browser the ip address does appear.
The problem is that the first part of the JavaScript line containing the
'<!--#echo var="REMOTE_ADDR"-->' (namely, the var ip =) does not appear
although the final ' and ; do appear. Thus the JavaScript variable ip is not
set to the value of the ip address and the rest of the JavaScript coding
does not have the value to process.
Since other people seem to have used this coding I do not understand why it
does not work for me.
Any suggestions? I do not know what 'configure it to parse the HTML document
for SSI directives' means or how to do it.
Thank you.
Doug van Vianen
"David Dorward" <dorward@yahoo.com> wrote in message
news:bofhi5$g86$2$8302bc10@news.demon.co.uk...[color=blue]
> Doug van Vianen wrote:
>[color=green]
> > I recently found the following JavaScript code which is supposed to let
> > one find then use the ip address of the person accessing the web page
> > containing the script.[/color]
>[color=green]
> > var ip = '<!--#echo var="REMOTE_ADDR"-->';[/color]
>
> I am never ceased to be amazed by the number of places which claim that is[/color]
a[color=blue]
> JavaScript way to find out the IP address. It isn't. Its an SSI
> <http://www.bignosebird.com/ssi.shtml> way, it just happens to be placed[/color]
in[color=blue]
> the middle of a block of JavaScript, so the value is available to
> JavaScript when the page is loaded.
>[color=green]
> > There are various forms of this code which displays the ip address in an
> > alert box, in a text box in a form, etc but none work for me. When I
> > access a page with the above in it (along with the appropriate text box[/color][/color]
in[color=blue][color=green]
> > the body of the page) nothing happens. However, when I view the source[/color][/color]
of[color=blue][color=green]
> > the page with the browser view item, the source of the page appears with
> > the line[/color]
>
> You have to place the page on a server that supports SSI, and configure it
> to parse the HTML document for SSI directives.
>
>
> --
> David Dorward
http://dorward.me.uk/[/color]