I'm having trouble redirecting after having a user fill out a form. In order to test functionality of my redirect, I've created a simple form where a user enters an email address and a name. The form calls itself to do a simplified validation, and then gets redirected to another page. Problem is...the page will not redirect. As you can see from the enclosed code, I've tried both methods of redirection using header(location: URL) and zen_redirect(URL). Right now, the redirection does not occur and results in my form main_page being blank.
My form resides in my template in define_my_test_page.php.
Thanks for any help,Code:<? $message = ""; $emailclass = "basictext"; $username = ""; if ($_POST['process'] == 1) { $pattern = '/.*@.*\..*/'; $email = $_POST['email']; $urlname = urlencode($$_POST['username']); if (preg_match($pattern, $_POST['email']) > 0) { // Here's where you would store // the data in a database... header("location: index.php?main_page=my_product_home"); //zen_redirect("index.php?main_page=my_product_home"); } $message = "Please enter a valid email address."; $username = $_POST['name']; $emailclass = "errortext"; } ?> <html> <style> .basictext { font-family: Arial, Helvetica, sans-serif; font-size: 14px; color:#000066; } .errortext { font-family: Arial, Helvetica, sans-serif; font-size: 14px; color:#C00000; font-weight: bold; } </style> <body> <form action="index.php?main_page=my_test_page" method="post"> <? if ($message != "") { print '<span class="errortext">'. $message."<span><br>\n"; } ?> <span class="<?print $emailclass; ?>"> Email address:</span> <input name="email" type="text" class="<? print $emailclass; ?>"><br> <span class="basictext">Your name:</span> <input name="name" type="text" class="basictext" value="<?print $username; ?>"><br> <input type="hidden" name="process" value="1"> <input type="submit" name="Button1" value="Sign up!"> </form> </body></html>
Dustin



