Hello,
I'm an HTML coder, and am learning how to integrate JS and PHP into form
functions.
I'm trying to engineer a form that will return the user's IP address as a
hidden input field.
I found a code snippet to capture the visitor's IP as such:
==================
<SCRIPT>
var ip = new java.net.InetAddress.getLocalHost();
var ipStr = new java.lang.String(ip);
document.writeln(ipStr.substring(ipStr.indexOf("/")+1));
</SCRIPT>
========================
and I tried to use the variable (both as "ip" and as "ipStr"), but with the
resulting form return yeilding "undefined".
my hidden field is generated by a Document.write statement as such:
===========================
<script type="text/javascript">
document.write ('<input type="hidden" name="ip_number" value="' + ipStr +
'">');
</script>
===========================
thanks for any help in solving this!
Tam