Hi all, here my simple code: <?php $name = $_REQUEST['name']; $email = $_REQUEST['text']; $comment = $_REQUEST['comment']; mail( "mymail@xyz.xz", "Feedback Form", $name, $comment, "From: $email" ); header( "Location: http://www.megawhite.au" ); ?> Code (markup): I need to check, if ALL of the fields are filled. If yes - then go to www.megawhite.. if NOT - to some other www. I know, that it is somehow possible with "empty" command.. Can You put me on the right way, please? Thanx.
how about: if ($name && $email && $comment) { header( "Location: http://www.megawhite.au" ); } else { header( "Location: http://www.someothersite.com" ); } PHP: ?
name: 1, email: 1, comment: 1 form filled! How about: Turn register_globals off first. <?PHP if (!empty($_POST['email'])) && preg_match("(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])", $_POST['email'])) { $email = $_POST['email']; } if (!empty($_POST['name'])) && preg_match("/^[A-Za-z]{1,}\s[A-Za-z\']{2,}$/", $_POST['name'])) { $name = $_POST['name']; } if (!empty($_POST['comment']) && preg_match("/^[A-Za-z0-9\s.-\#\@\x10\x13]{10,}$/")) { $comment = $_POST['comment']; } if (isset($name) && isset($email) && isset($comment)) { header("Location: http://www.megawhite.au/", 200); } else { header("Location: http://www.google.com.au/", 403); } ?> PHP: