Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Sep 2006
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Puting variables in a URL, then using them on the page?

    I have an email form, which places the senders name or email address in the URL when redirecting to the error page or completed page in the style "ok.html?email=whatever@whoever.com"... how do I then use the "email" variable in the page so I can make the page text say something along the lines of "you will be recieving a reply to 'whatever@whoever.com' shortly."?

  • #2
    Regular Coder
    Join Date
    Oct 2003
    Location
    on a ship
    Posts
    574
    Thanks
    1
    Thanked 6 Times in 5 Posts
    check out this thread that i recently posted the answer to a similar question
    it will need to be modified of course, to do what you wnat, but it should point you in the right direction.

    How do I do this ?
    I make no attempt at pretending like I'm a professional. I offer help with what knowledge I do have.

  • #3
    New Coder
    Join Date
    Sep 2006
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Alright.. I think I understand some of that.

    How do I go about telling it that the variable to write is in the URL, though? This code sample used a form to submit variables... my page is using a form to submit to ASP, then having the ASP code redirect to a URL.

    (I.E., the asp code at the end looks like this: "Response.Redirect("ok.htm?" & EmailFrom)")
    Last edited by WiglyWorm; 12-03-2006 at 07:32 PM.

  • #4
    Regular Coder
    Join Date
    Oct 2003
    Location
    on a ship
    Posts
    574
    Thanks
    1
    Thanked 6 Times in 5 Posts
    with asp you should be able to strip out the query string. then assign it to a variable. and when you redirect, you add the variable to the end of the path.
    I make no attempt at pretending like I'm a professional. I offer help with what knowledge I do have.

  • #5
    Regular Coder
    Join Date
    Oct 2003
    Location
    on a ship
    Posts
    574
    Thanks
    1
    Thanked 6 Times in 5 Posts
    you can use the same script to submit to an asp file. just make sure that the contents of the asp file look something like this:


    Code:
    <%@ language="VBScript" %>
    <% formdata=Request.QueryString() %>
    <% Response.Redirect("otherfile.htm?" & formdata) %>
    I make no attempt at pretending like I'm a professional. I offer help with what knowledge I do have.

  • #6
    New Coder
    Join Date
    Sep 2006
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm not sure if the question was clear.

    I have an e-mail form that directs to an asp script. That asp script then has a line in it:

    [code]
    Response.Redirect("ok.htm?" & EmailFrom)
    [code]

    I want "ok.htm" to say "thank you {e-mail@address}"

    I was told that this java should do it for me:

    Code:
    var email = location.href; 
    var x = email.search('=') + 1; 
    email = email.slice(x,email.length); 
    document.getElementById("some <p id=">").write('Thanks for registering ' + email);
    However, that hasn't seemed to do anything for me for some reason.


  •  

    Posting Permissions

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