I don't think D's method will work as it'll be the cgi script doing the redirect. I'm not sure how cgi does redirects but if it sends a redirect command to the client, rather than a server side redirect, then the thanks.asp page will have not access to the original form values.
If this is the case I can see 2 ways of doing this.
1) A bit of JavaScript that sets the redirect value before submitting the form. The thanks.asp page can use the querystring value as D suggested.
I've changed the name of the 'E-MailSubject' form element to EmailSubject. You'd also need to add an action for the onsubmit event for the form element, onsubmit="setRedirect();".
Code:
<script type="text/javascript">
function setRedirect() {
var strUrl;
var objRedirect = document.getElementById("redirect");
var objBase = document.getElementById("redirect_base");
var objEmail = document.getElementById("EmailSubject");
if (objRedirect && objBase && objEmail) {
//Build the redirect url
strUrl = objBase.value + "?type=" + escape(objEmail.value);
//Set the new url
objRedirect.value = strUrl;
}
return true;
}
</script>
2) Modify the cgi script to determine the page to be redirected to. I've got no experience with cgi so maybe someone else can help with this.
Edit:
Forgot to add that you'll need to add another hidden form field 'redirect_base' with the value set to the url of the ASP page that the cgi will redirect to.
Bookmarks