Saj
05-01-2003, 07:42 PM
OK, I'm just checking if the fields are not empty, and this doesn't seem to be working....I'm a newb to php so I'm sure its just a very simple error.
here is board.php
<form action="addmsg.php" method="post" name="message">
<input type="text" size="53" maxlength="19" name="name" />
<input type="text" size="53" maxlength="19" name="email" />
<textarea cols="40" rows="6" name="msg"></textarea>
<input type="submit" id="submit" value="Submit" name="submit" />
</form>
and addmsg.php
<?php
if (!$name || !$email || !$msg) {
header("Location: board.php?error");
}
else {
echo "Success!";
}
?>
Thanks
here is board.php
<form action="addmsg.php" method="post" name="message">
<input type="text" size="53" maxlength="19" name="name" />
<input type="text" size="53" maxlength="19" name="email" />
<textarea cols="40" rows="6" name="msg"></textarea>
<input type="submit" id="submit" value="Submit" name="submit" />
</form>
and addmsg.php
<?php
if (!$name || !$email || !$msg) {
header("Location: board.php?error");
}
else {
echo "Success!";
}
?>
Thanks