Created a great form, emailing works great, but no validation yet. I have tried different things and it works for text boxes but not drop downs and ect. I'm trying to find some basic validation to make sure there is data in the field and a drop down is selected. No security is really needed since this will be for internal AD protected use. I have an htm form submitting to this php page to send email. Any tips on validation for these.
Code: Select all
<?php
// REQUEST FORM DATA \\
$remail = $_REQUEST['remail'] ; // Text Box - Required
$rlname = $_REQUEST['rlname'] ; // Text Box - Required
$rfname = $_REQUEST['rfname'] ; // Text Box - Required
$nalname = $_REQUEST['nalname'] ; // Text Box - Required
$nafname = $_REQUEST['nafname'] ; // Text Box - Required
$napoffice = $_REQUEST['napoffice'] ;// Combo Box - Required - (Values = 0 to 9) - (0 = Select Field)
$najtitle = $_REQUEST['najtitle'] ;// Combo Box - Required - (Values = 0 to 14) - (0 = Select Field)
$na1a = $_REQUEST['na1a'] ;
$na1b = $_REQUEST['na1b'] ;
$na1c = $_REQUEST['na1c'] ;
// HEADER INFORMATION \\
$to = "support@azvent.com";
$subject = "New User Request";
$header = "From: $rfname \r $rlname";
// BODY CONTENT \\
$message = ":::Requestee Information::: \n\n". "$rlname, $rfname \n".
"$remail \n\n". ":::New User Information::: \n\n". "$nalname, $nafname \n".
"$napoffice, $najtitle \n\n". "Requires Phone Extention:\n".
"$na1a, $na1b, $na1c";
// FORM VALIDATION \\
echo "$message";
?>