Forum Moderators: open

Message Too Old, No Replies

how to assign a value to an html variable

         

qwik

11:24 pm on Feb 3, 2005 (gmt 0)

10+ Year Member




I have a form that submits user inputed information into an access database.. now I want to collect the IP address of each user too.. im using .asp with vbscript.. for the life of me i cant figure out how to assign the IP value to a text field.. any ideas?

im using request.serverVariables("LOCAL_ADDR") to get the IP and store it in a variable.. then I have been trying to assign this value to a hidden textfield but cant figure it out..

any help is much appreciated..

-qwik

Bernard Marx

12:49 am on Feb 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is pure ASP, isn't it? No client-side script needed.

something like:

<input type="hidden" value="<?request.serverVariables("LOCAL_ADDR")?>">

..or thereabouts.

qwik

1:20 am on Feb 4, 2005 (gmt 0)

10+ Year Member



if its that easy, im jumping out my window.. ive been at this for hours.. bought 2 books..

thank you very much for your help :)

-qwik

qwik

1:35 am on Feb 4, 2005 (gmt 0)

10+ Year Member



<input name="Timeq" type="hidden" value="<%request.ServerVariables("LOCAL_ADDR")%>"

i tried this several times and it doesnt post to the database.. am i leaving something out?

-qwik

Bernard Marx

8:23 am on Feb 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I dunno. Have you tried looking at the source of the HTML page that you receive at the browser?

I may have missed something out. This is a question for the ASP forum, I'm sure.

qwik

7:35 pm on Feb 7, 2005 (gmt 0)

10+ Year Member



Bernard, thanks for the help.. you got me on the right page.. the working version ended up looking like this fwiw..

<input name="ipq" type="hidden" value="<%=Request.ServerVariables("REMOTE_ADDR")%>">