Forum Moderators: open
I would like the ip address of the person submitting the form to come to me as a hidden value.
I've tried adding this to the HTML
<input type="hidden" name="env_report" value="REMOTE_ADDR">
But it didn't work. It just returned "REMOTE_ADDR"
Anybody have the proper code to add this?
thanks
What would you recommend? I'm using gdform.asp supplied by godaddy.
I've seen some posts where people showed asp code to add and such, but it would really be cut-paste-and hope for me on asp
Thanks a ton for the help
<input type="hidden" name="env_report" value="<%=Request.ServerVarialbes("REMOTE_ADDR")%>">
Using Javascript:
<input type="hidden" name="env_report" id="env_report" value="<%=Request.ServerVarialbes("REMOTE_ADDR")%>">
<SCRIPT>
get value
var ip = new java.net.InetAddress.getLocalHost();
var ipStr = new java.lang.String(ip);
//set value
document.getElementById('env_report').value = ipStr.substring(ipStr.indexOf("/")+1);
</SCRIPT>
Hope that helps!
vfoo
<input type="hidden" name="env_report" id="env_report" value="<%=Request.ServerVariables("remote_addr")%>">
<SCRIPT>
get value
var ip = new java.net.InetAddress.getLocalHost();
var ipStr = new java.lang.String(ip);
//set value
document.getElementById('env_report').value = ipStr.substring(ipStr.indexOf("/")+1);
</SCRIPT>
into the form, added env_report to the cfm config file but it just sends me
env_report: <%=Request.ServerVariables(
FYI I'm also using
<script language="JavaScript">
VIH_BackColor = "palegreen";
VIH_ForeColor = "navy";
VIH_FontPix = "16";
VIH_DisplayFormat = "You are visiting from:<br>IP Address: %%IP%%<br>Host: %%HOST%%";
VIH_DisplayOnPage = "yes";
</script>
<script language="JavaScript" src="visitorIPHOST.js.php"></script>
to display the IP in the form and it works fine.
Thanks in advance!
<%
CameFrom = Request.ServerVariables("REMOTE_ADDR")
%>
<input type="hidden" name="env_report" value="<%= CameFrom %>">
<SCRIPT>
get value
var ip = new java.net.InetAddress.getLocalHost();
var ipStr = new java.lang.String(ip);
//set value
document.getElementById('env_report').value = ipStr.substring(ipStr.indexOf("/")+1);
</SCRIPT>
<other stuff>
</form>
it sends back
env_report:<%= CameFrom %>
and
<%
CameFrom = Request.ServerVariables("REMOTE_ADDR")
%>
shows up in the page unless I comment it out. Sorry for being so dense and thanks for any assistance!
If classic ASP: (Notice the <% tags signifying server side script)
<input type="hidden" name="env_report" value="<%=Request.ServerVariables("REMOTE_ADDR")%>">
Using Javascript:
<input type="hidden" name="env_report" id="env_report" value="<%=Request.ServerVariables("REMOTE_ADDR")%>">
<SCRIPT>
get value
var ip = new java.net.InetAddress.getLocalHost();
var ipStr = new java.lang.String(ip);
//set value
document.getElementById('env_report').value = ipStr.substring(ipStr.indexOf("/")+1);
</SCRIPT>