I am creating a cgi script which processes the data from my form and e-mails the results to me. What I would like to know is, is it possible to forward the user to a page on my website after the email has been sent ? If so how do I do that ??
Any help appreciated
07-04-2002, 07:52 PM
Matt Wright's formmail.pl is the "industry standard" (why invent the wheel???) and includes redirection such as you require.
I am trying to create my own cgi script, because I like a challenge and I want to try and learn cgi without just cutting and pasting scripts here and there.
07-05-2002, 02:32 PM
It is possible to forward the user to another page after they have finished. If your login page is in HTML, then your form will probably call on your CGI script. In that case, simply place:
print "Content-type: text/html\n\n";
#enter in the html for the page to be redirected to here
If the page you want to redirect the user to is in HTML, the most intuitive way (for now) to do it is by:
<body><script>window.location = ""</script> #Redirect URL in the quotes
Thanks for your reply, I will give that a try !!
Matt's FormMail, and all of Matt's scripts, have extreme security problems, huge holes...massive problems. They always have...try and avoid using them entirely, or make sure you can plug the holes yourself.
You also could do a redirect that is pure cgi and much faster (and not depending on the way the user has their browser setup).
print "Location : http://www.yoursite.com/thankyou\n\n;"
And note that you would have to make sure that this line of code is executed without the content type of text/html or it will just print that line to the client.
I've attached a script that I used to use a while back...
07-05-2002, 09:43 PM
Sweet, you can do that feyd? *takes down notes*. Awesome jawsome :cool: !