IP Address

tekstylez

New Member
I'm trying to find a good way to grab ip addresses from users. I've found many javascripts to put into the header of my pages, however, they all give me errors in webspeed. for example:

<SCRIPT language = javascript>var ip = new java.net.InetAddress.getLocalHost();var ipStr = new java.lang.String(ip);document.writeln(ipStr.substring(ipStr.indexOf("/")+1));</SCRIPT>
when i use that, it compiles fine, but when I try to run the page, I get a javascript error 'java' is undefined.

or when I try this code:
<script language="javascript">
//IP address display: By http://www.Hostroute.com
//Script featured on JavaScript Kit (http://www.javascriptkit.com)
var ip = '<!--#echo var="REMOTE_ADDR"-->'
function ipval() {
document.myform.ipaddr.value=ip;
}
window.onload=ipval
</script>

this won't even compile, it will give me an error saying "Unknown Field or Variable Name '!--#echo' "

anyone have any ideas? Thanks!

*and yes, i've been using the {&OUT} / ~n'. tags in webspeed
 
webspeed understands env-variables. Cause its included in src/web/method/cgidefs.i
Code:
put unformatted  REMOTE_ADDR .

should give you the value.
 
Hi,

if your trying to assign it to a progress variable then you would just assign it.

In webspeed this REMOTE_ADDR is a variable.

assign cVar = REMOTE_ADDR .

hope that is what your trying. or if your talking about Javascript.. let me know.
 
I'm giving that a try, but its saying that REMOTE_ADDR is an unknown field blah blah blah, I'm not sure because I wasn't the one who installed the system, but I can't seem to locate the .i file you mentioned before. actually, i can't seem to even find the path. This is probably why this variable is missing.
 
Back
Top