PHP Form with drop down

Junior Spellweaver
Joined
Jun 5, 2005
Messages
192
Reaction score
1
I just need it to be able to submit the info in the drop down menus.

this is an example of what I need:
Contact

but thats jsut html the php is not suited for it it origionally had 4 text spaces for the info...
Name, Emial, Subject, Message,

I changed some stuff in the html part but the php hasnet been fixed for the other fields. Can someone please fix up the php for it please
 
PHP:
<?php

$Email = Trim(stripslashes($_POST['email'])); 
$EmailTo = "[email protected]";
$Subject = "Jonzdesigns - Site Contact";
$Name = Trim(stripslashes($_POST['name'])); 
$Subject = Trim(stripslashes($_POST['subject'])); 
$Message = Trim(stripslashes($_POST['message'])); 

$validationOK=true;
if (Trim($Email)=="") $validationOK=false;
if (Trim($Name)=="") $validationOK=false;
if (Trim($Subject)=="") $validationOK=false;
if (Trim($Message)=="") $validationOK=false;
if (!$validationOK) {
  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">";
  exit;
}

$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Subject: ";
$Body .= $Subject;
$Body .= "\n";
$Body .= "Message: ";
$Body .= $Message;
$Body .= "\n";

$success = mail($EmailTo, $Subject, $Body, "From: <$Email>");

// redirect to success page 
if ($success){
  print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.html\">";
}
else{
  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">";
}
?>
 
Back