*wheeeeee, let's post responses that are actually incorrect! =D*
Ok, clearly, a client-side validation is useless, as the user is able to go around that very easely. Just use the server-side validation. (In the PHP code.) (Usually the 2 are combined.)
The META-redirect should work, but is not the recommended way to do things...
Required field:
PHP Code:
<?php
//Checks required-name
if($_POST["required-name"] == "") {
?>
HTML CODE FOR FAILED VALIDATION GOES HERE.
<?php
//Or: to use a redirect, remove the 3 above lines and use a header("Location: url");
exit;
}
$text = "Name: {$_POST["required-name"]}\n";
$text .= "Email: {$_POST["email"]}\n";
$text .= "Phone number: {$_POST["phone"]}\n";
$text .= "Attending: {$_POST["attendance"]}\n";
$text .= "Comments: {$_POST["comment"]}";
mail("vt@8473973495.com", "Outing Attendance", $text);
?>
If you want to redirect:
PHP Code:
<?php
$text = "Name: {$_POST["required-name"]}\n";
$text .= "Email: {$_POST["email"]}\n";
$text .= "Phone number: {$_POST["phone"]}\n";
$text .= "Attending: {$_POST["attendance"]}\n";
$text .= "Comments: {$_POST["comment"]}";
@mail("vt@8473973495.com", "Outing Attendance", $text);
header("Location: http://www.google.com");
exit;
?>
To use html:
PHP Code:
<?php
$text = "Name: {$_POST["required-name"]}\n";
$text .= "Email: {$_POST["email"]}\n";
$text .= "Phone number: {$_POST["phone"]}\n";
$text .= "Attending: {$_POST["attendance"]}\n";
$text .= "Comments: {$_POST["comment"]}";
mail("vt@8473973495.com", "Outing Attendance", $text);
?>
PUT HTML HERE.
- Marshian