Okay here is my web form according to your suggestion. Thanks a million to take some time out of your day to look at this...
<tr><td>Choose a 4 digit numeric employee code:</td>
<td><input type="password" name="code" size ="4" maxlength="4" value="<? if(isset($code)){ echo $code; }?>"></td>
</tr>
<tr><td>Please retype your 4 digit numeric code:</td>
<td><input type="password" name="verify_code" size ="4" maxlength="4" value="<? if(isset($verify_code)){ echo $verify_code; }?>"></td>
And here is my form mailer that will check for verification and will send the email.
<?
ob_start();
foreach ($Module as $Mods) {
$Modtext.=$Mods . "\n\t\t ";
}
foreach ($RTP as $RTPPos) {
$RTPJob.=$RTPPos . "\n\t\t\t";
}
$message = <<<EOD
USER REQUEST FORM
==> SECTION 1 USER INFORMATION
What to do with the user: $HTTP_POST_VARS[Required_Mode]
Users Name: $HTTP_POST_VARS[Required_Users_Name]
Company: Northstar-at-Tahoe
Department: $HTTP_POST_VARS[Required_Department]
Phone: $HTTP_POST_VARS[Phone_Prefix]-$HTTP_POST_VARS[Phone_Suffix] Ext$HTTP_POST_VARS[Phone_Ext]
Voice Mail: $HTTP_POST_VARS[Voice_Mail]
Manager: $HTTP_POST_VARS[Required_Manager]
Managers Email: $HTTP_POST_VARS[Required_Email_Address]
==> SECTION 2 JDEDWARDS
Users Class: $HTTP_POST_VARS[Required_JDEdwards]
Access To: $Modtext
==> SECTION 3 CSS
Employee Code: $HTTP_POST_VARS
Security Level: $HTTP_POST_VARS[Security_Level]
==> SECTION 4 KRONOS TIME KEEPER
Kronos Department: $HTTP_POST_VARS[Kronos_Department]
User Class: $HTTP_POST_VARS[Kronos]
Similar Profile
Access As: $HTTP_POST_VARS[Kronos_Similar_Profile]
==> SECTION 5 NOVELL NETWORK
Similar Network Access as: $HTTP_POST_VARS[Novell_Department]
Access To Specific
Network Folders: $HTTP_POST_VARS[Novell_Folders]
Novell Password: $HTTP_POST_VARS[Novell_Password]
==> SECTION 6 EMAIL/INTERNET REQUEST
Does Employee Require Internet Access: $HTTP_POST_VARS[Internet_Access]
Does Employee Require Email: $HTTP_POST_VARS[Required_Email]
Email/Internet Password: $HTTP_POST_VARS[Email_Password]
==> SECTION 7 RESORT POS
Which Modules ?: $RTPJob
Responsible for closing at the end of the day?: $HTTP_POST_VARS[Close_RTP]
Verified Before Sending: $HTTP_POST_VARS[Verification]
EOD;
$form = ('http://spylos.boothcreek.net/drummel/nurf.php');
$ToAddress = ('drummel.ns@boothcreek.com');
$FromAddress = $HTTP_POST_VARS[Required_Email_Address];
$Subject = "User Request form for $HTTP_POST_VARS[Required_Users_Name] ";
//Error Checking
// Check to make sure email address is valid
function checkEmail($Required_Email_Address)
{
if(ereg( "^[^@ ]+@([a-zA-Z0-9\-]+\.)+([a-zA-Z0-9\-]{2}|net|com|gov|mil|org|edu|int)$",$Required_Email_Address) )
return true;
else
return false;
}
if (empty($Required_Mode) || empty($Required_Users_Name) || empty($Required_Department) || empty($Required_Manager)
|| empty($Required_Email_Address))
{
header( "Location: Error.html" );
}
else if
(!is_numeric($Phone_Prefix) || !is_numeric($Phone_Suffix) || !is_numeric($Phone_Ext))
{
header ("Location: phonenumber.html");
}
else if
(!checkEmail($Required_Email_Address))
{
header("Location: emailerror.html" );
}
else if
(empty($Verification))
{
header("Location: verify.html");
}
else if
($code != $verify_code)
{
echo $form;
}
else if ($Novell_Password != $Verify_Novell_Password)
{
header("Location: NovellPassword.html");
}
else if ($Email_Password != $Verify_Email_Password)
{
header("Location: EmailPassword.html");
}
else
{
$headers = "From: $FromAddress\r\n";
mail($ToAddress,$Subject,$message,$headers);
header("Location: Thanks.html");
exit;
ob_end_flush();
}
?>