View Full Version : Puting variables in a URL, then using them on the page?

12-02-2006, 08:05 AM
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."?

12-02-2006, 08:48 AM
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.


12-03-2006, 08:30 PM
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)")

12-03-2006, 11:36 PM
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.

12-04-2006, 12:01 AM
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:

<%@ language="VBScript" %>
<% formdata=Request.QueryString() %>
<% Response.Redirect("otherfile.htm?" & formdata) %>

12-04-2006, 08:05 PM
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:

Response.Redirect("ok.htm?" & EmailFrom)

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

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

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.