We help IT Professionals succeed at work.

In Dreamweaver CS3 Forms Submit button need redirect code back to page after form is submitted to CGI server

vaughnn asked
After pages user clicks submit button on form I want the page to redirect to same page or possibly to new page on the site. What happens now is form is submitted correctly to my Hosting provider and a e-mail is sent back, just like it's should work. Problem is I get a error page on the site. Please advise code I should use for redirect.  I am using Dreamweaver CS3 Mac. to build the site.
Thank you.
Watch Question

Don't talk to me.
Hi vaughnn,

Whatever script is processing the form should have some way to set the redirect.  
What is the error you're getting?  If it's page not found, make a note of the page that it's looking for, and create that page either make it redirect using meta refresh, or have it say "thank you" or something like that.
Hi vaughnn

What you could do is a javascript redirect once the form is processed.  Lets say you have a script called process.php (or any other language).  Once its done emailing the form etc, send this output to the browser:

<script type="text/javascript">
window.location = "http://www.yoursite.com/your_page.html"

On php this can be done using the echo command as follows:

echo '<script type="text/javascript">';
echo '<!--';
echo 'window.location = "http://www.yoursite.com/your_page.html"';
echo '//-->';
echo '</script>';

You can replace the website with anything you want.  If you require the code for other scripting languages or any other info, let me know.


Explore More ContentExplore courses, solutions, and other research materials related to this topic.