Posted by deko on 06/12/06 22:07
> The form processing should be the *first* thing in the file.
> Something like:
>
> DOCTYPE ...
> <?php
> if( isset($_POST['foo'] ) {
> // do form processing
>
> if( $isValid ) {
> header();
> exit;
> }
> }
> ?>
> <form action="..." method="POST">
> ...
> <input type="text" name="foo" size="10" maxlength="255">
> <input type="submit">
> </form>
Thanks, that helped. I am getting the correct redirect behavior now.
But I still have a couple of questions...
Here's how it looks now:
------------------------
<?php
$message = $_POST['message'];
$email = $_POST['email_address'];
if (!empty($message) && !empty($email))
{
header("Location:http://bubba/send-confirm.php");
exit;
}
?>
DOCTYPE
<html>
....
....
<form action=<?php include "myscript.php" ?> method="POST">
<input name="email_address" type="text" size="10" maxlength="255">
<textarea name'"message" rows="12" cols="22"> </textarea>
<input type="submit" value="Send">
</form>
....
....
</html>
--------------------------
Does my form look correct?
What form attributes are required (which are optional) - name, type, method... ?
Am I properly referencing "myscript.php"? Do I need the include statement?
Thanks again for you help!
[Back to original message]
|