You are here: Re: How to redirect after form submit? « PHP Programming Language « IT news, forums, messages
Re: How to redirect after form submit?

Posted by deko on 06/12/06 15:06

> Put all the stuff that does output ("<form...", "<input...") after the
> header() call.

Okay, here's the header call:

<?php if ($valid_message)
{
header("Location:http://www.mysite.com/send-confirm.php");
exit();
}
?>

And here's the form:

<form action="
<?php
$message = trim($_REQUEST['message']);
$email_address = trim($_REQUEST['email_address']);
if (empty($message) || empty($email_address))
{
$valid_message = false;
}
else
{
mail( "my email address", "feedback form", $message, "from:
$email_address" );
$valid_message = true;
}
?>" method="POST" name="feedback" style="font-size:12px" >
<input name="email_address" type="text" size="30"/><br />
<textarea name="message" rows="12" cols="23"></textarea><br />
<input type="submit" value="Send">
</form>

I no longer get the error, but the page does not redirect.

I'm sure I must be missing something simple...

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация