I am working on a site using Dreamweaver which means, of course, that it is .html. I am trying to set up a "Contact Us" form. I downloaded a php script which gives me a Contact Us form that prevents spam and email injection and does not use CAPTCHA. It seems perfect for my needs. To implement the script I only need an "include" command in the page. I set my Contact Us link in my menu to point to a .php page that contains only the include command. <?php include "contact_us.php"; ?> (contact_us.php is the script I downloaded) When I click on the Contact Us link in my menu it runs the script fine. The problem I am having is that , after filling out the Contact Us form and clicking the "Submit" button, I get a message that says the information was sent successfully, (and in fact it was), but then it just sits there with no way to get back to the home page or a thank you page. I know only very little about php programming but I tried altering the code to use a header ("location: index.htm"); but I get the famous "Headers already sent" error. I also tried using <meta http-equiv="refresh" content="1;url=http://www.mysite.com/index.htm"> but that didn't work either because I think it has to be used in an html page rather than in a .php script. Finally, I tried using this line in the form. <input name="redirect" type="hidden" value="index.htm"> The problem here is that, while it did in fact redirect to the index page, it did so before allowing the form to be filled in. It displays the form for about 2 seconds and then suddenly redirects to the index page. This would be great if it would allow the form to be filled out and redirect only after the "Submit" button was pressed. Can anybody offer any assistance with this problem? Thanks.
You can also use the php header() function to change the location. <?php header("Location: http://site.com"); ?> PHP:
Are you sure you have no place in the "contact_us.php" file where you are given the option to set a redirect page.