Hi, Can someone help provide directions on how i can add selective required fields on my make a request page (http://www.pcmechanix.ca/request.htm)? Thanks, Ash
Your question is a bit vague. But maybe this'll help you: <?php session_start(); $field = mysql_real_escape_string($_GET['field']); if(!$field){ // WTF? The field is empty! $_SESSION['form_error'] = "You must fill in the \"field\" field, jerk."; header("Location: http://www.pcmechanix.ca/request.php"); }else{ //All is good! header("Location: http://www.pcmechanix.ca/success.php"); } ?> Code (markup): Oh, and, you'll have to use PHP for the above example, in case you didn't notice. Can't use PHP? Then you're going to have to use JavaScript. Search "JavaScript form validation" on Google. It's not as secure as using a server-side check, but it'll work in a pinch.
You need to edit the file sendrequest.php add something like the following (you need to alter it to match the field NAMES on request.htm) session_start(); $error = 'no'; if (!isset($_POST['firstname'])){ header('location: request.htm?e=1'); exit(); } if ((!isset($_POST['email'])) || (!strstr($_POST['email'],'@')) || (!strstr($_POST['email'],'.'))){ header('location: request.htm?e=2'); exit(); } //etc... PHP: