Forums
This topic is locked
Collecting User IP and Inserting it into a DB
Posted 11 Sep 2004 20:18:14
1
has voted
11 Sep 2004 20:18:14 Rein van Spaendonck posted:
I need to get a user ip address and insert it into a database field. I tried it with a hidden field inside a form that also collects other data based on user input with an insert record server behaviour. The following code didn't seem to work:<pre id=code><font face=courier size=2 id=code> <form name="lsp" method="post" action="">
<input name="getUserData" type="hidden" id="getUserData" value="<%= Request.ServerVariables("REMOTE_HOST"">
</form> </font id=code></pre id=code>
I guess nothing is wrong with that, but it doesn't seem to insert the data in the database field in conjunction with the insert record server behaviour. Any ideas on how to do this?
Thanks in advance!
Replies
Replied 12 Sep 2004 14:28:21
12 Sep 2004 14:28:21 Rein van Spaendonck replied:
Thanks, but no, I already corrected that. The problem seems to be the insertion of the record. Does this code work with the 'insert record' server behaviour?
Replied 12 Sep 2004 21:29:20
12 Sep 2004 21:29:20 Rene Bandsma replied:
The Insert Record Behavior is just a few lines of code that can be inserted very easily. So your code works always with the behavior.
I think something is wrong with your code. I'll suggest you to make a new page with the Insert Record Behavior and, in code view, add the following line (before the </form> tag)
<pre id=code><font face=courier size=2 id=code><input type="hidden" name="getUserData" value="<5= Request.ServerVariables("REMOTE_HOST"5>"></font id=code></pre id=code>
<i>Replace the 5 with %... forum doesn't support the "<%" tags for security reasons.</i>
I think something is wrong with your code. I'll suggest you to make a new page with the Insert Record Behavior and, in code view, add the following line (before the </form> tag)
<pre id=code><font face=courier size=2 id=code><input type="hidden" name="getUserData" value="<5= Request.ServerVariables("REMOTE_HOST"5>"></font id=code></pre id=code>
<i>Replace the 5 with %... forum doesn't support the "<%" tags for security reasons.</i>
Replied 13 Sep 2004 10:06:50
13 Sep 2004 10:06:50 Rein van Spaendonck replied:
It worked! Thanks a lot!
Replied 13 Sep 2004 14:55:48
13 Sep 2004 14:55:48 Rene Bandsma replied:
<img src=../images/dmxzone/forum/icon_smile_big.gif border=0 align=middle>