I want to extract the user's IP address and put it into my form
without him/her knowing about it.
I have Javascript code (see below)
to get the user's "start time", which works just fine
(i.e., it's the time he/she accessed the web page).
I added "IP_ADDR" and corresponding code
that I got from web searches,
but can't figure out how to get it to work correctly
(all I get in the result e-mailed form is "IP_ADDR = (blank)").
Any help would be greatly appreciated!
================
<HTML>
<snip>
<SCRIPT LANGUAGE="JavaScript">
<!-- hide from non-Java browsers
<snip>
window.onload=function ()
{
var now=new Date();
document.forms[document.forms.length-1].START_TIME.value =
now.toLocaleTimeString();
document.forms[document.forms.length-1].IP_ADDR.value =
java.net.InetAddress.getLocalHost().getAddress();
}
<snip>
// end hiding
<snip>
<FORM NAME="TEST" METHOD="POST" ACTION="mail.pl">
<snip>
<INPUT TYPE="hidden" NAME="START_TIME">
<snip>
<INPUT TYPE="hidden" NAME="IP_ADDR">
<snip>
<INPUT TYPE="submit" NAME="Submit" VALUE="SUBMIT">
<snip>
</FORM>
<snip>
</HTML>
-----
Bond . . . James Bond
Do not reply via e-mail.
The address is phony to prevent spam, etc.
Thank you for understanding.