Results 1 to 8 of 8

Thread: HTML/ASP variables from querystring to SUBMIT

  1. #1
    Senior Member
    Join Date
    Jul 2003
    Location
    Pit, stone.
    Posts
    643
    Thanks
    0
    Thanked
    0 times in 0 posts

    Question HTML/ASP variables from querystring to SUBMIT

    Ugh. Bit of a simple one, I thought, but apparently not.

    I'm kicking off with a link in an email with a variable reference number (?urn=xxx for example - the URN is generated in the original email program which works fine).

    Clicking that takes you to a "Please give us your feedback!" webpage with a couple of questions. Submit that, and the values in the form and the reference number is written via a submit script to a text file.

    I can get the form data to submit, but NOT my reference number (which I'm getting using

    <%
    urnval=request.querystring("urn")

    response.write(urnval) for debugging to show I'm getting the value!
    %>
    )

    then submit using a standard form, but I need the line

    <input type="hidden" name="urnval" value=urnval>

    but of course that writes the string "urnval" in my text file!

    How in hell do I submit the VALUE of the variable urnval, rather than the text?

    Preferably with ASP or javascript - if it's not possible I have someone here who is a PERL/PHP guy and can do it all very simply, but it'd be nice to know...
    Well Hello!

  2. #2
    Commander Keen
    Join Date
    Nov 2003
    Location
    217.27.240.214
    Posts
    624
    Thanks
    0
    Thanked
    0 times in 0 posts
    does the "response.write(urnval)" print out the correct value ?

    I am off learning a little ASP.. sometimes a fools perspective can be useful !

  3. #3
    Commander Keen
    Join Date
    Nov 2003
    Location
    217.27.240.214
    Posts
    624
    Thanks
    0
    Thanked
    0 times in 0 posts
    because if that is the case..

    you SHOULD be able to do this...

    <input type="hidden" name="<%=urnval%>" value=urnval>

    but note... I have never written any ASP before.

  4. #4
    bored out of my tiny mind malfunction's Avatar
    Join Date
    Jul 2003
    Location
    Lurking
    Posts
    3,923
    Thanks
    191
    Thanked
    187 times in 163 posts
    • malfunction's system
      • Motherboard:
      • Gigabyte G1.Sniper (with daft heatsinks and annoying Killer NIC)
      • CPU:
      • Xeon X5670 (6 core LGA 1366) @ 4.4GHz
      • Memory:
      • 48GB DDR3 1600 (6 * 8GB)
      • Storage:
      • 1TB 840 Evo + 1TB 850 Evo
      • Graphics card(s):
      • 290X
      • PSU:
      • Antec True Power New 750W
      • Case:
      • Cooltek W2
      • Operating System:
      • Windows 10
      • Monitor(s):
      • Dell U2715H
    You've set the value of the form element "urnval" to the value urnval in that bit of HTML there - i.e. a string constant - and not a variable in the ASP script. What you need to do (as KillgORE is trying to point out) is put the value of the variable from the e-mail link into the HTML page. The correct ASP would be:

    <input type="hidden name="urnval" value="<%= urnval%>"/>

    Or if you don't want / need to declare it as a variable in the ASP just use:

    <input type="hidden name="urnval" value="<%= Request.QueryString("urnval")%>"/>

  5. #5
    Commander Keen
    Join Date
    Nov 2003
    Location
    217.27.240.214
    Posts
    624
    Thanks
    0
    Thanked
    0 times in 0 posts
    LOL... crap.. Can't believe I put the variable there !!! d'ho... Should have re-read that.

  6. #6
    bored out of my tiny mind malfunction's Avatar
    Join Date
    Jul 2003
    Location
    Lurking
    Posts
    3,923
    Thanks
    191
    Thanked
    187 times in 163 posts
    • malfunction's system
      • Motherboard:
      • Gigabyte G1.Sniper (with daft heatsinks and annoying Killer NIC)
      • CPU:
      • Xeon X5670 (6 core LGA 1366) @ 4.4GHz
      • Memory:
      • 48GB DDR3 1600 (6 * 8GB)
      • Storage:
      • 1TB 840 Evo + 1TB 850 Evo
      • Graphics card(s):
      • 290X
      • PSU:
      • Antec True Power New 750W
      • Case:
      • Cooltek W2
      • Operating System:
      • Windows 10
      • Monitor(s):
      • Dell U2715H
    Quote Originally Posted by killgORE
    LOL... crap.. Can't believe I put the variable there !!! d'ho... Should have re-read that.
    Yep - you got the ASP right but the HTML sucks

  7. #7
    Commander Keen
    Join Date
    Nov 2003
    Location
    217.27.240.214
    Posts
    624
    Thanks
    0
    Thanked
    0 times in 0 posts
    I er... was rushing there to learn the ASP.. and erm.. my mate is supposed to have arrived for flat hunting. And erm ... is that the time ?

    [edit]

    how about these tutorials... They taught me everything I know about ASP...

    here
    Last edited by killgORE; 28-06-2004 at 01:08 PM.

  8. #8
    Senior Member
    Join Date
    Jul 2003
    Location
    Pit, stone.
    Posts
    643
    Thanks
    0
    Thanked
    0 times in 0 posts
    Cheers guys, works nicely! I think I did have the code right before, but there's a lag with updating to our server, so there's me testing it and nothing happens differently - I only figured it out when I set the field to being "text" rather than "hidden" and it didn't happen! Seems to cache...grr!!

    Ho hum!
    Well Hello!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •