View Single Post

  #6 (permalink)  
Old 22-03-2007, 11:02 PM
ziycon's Avatar
ziycon ziycon is offline
Wannabe Geek
Recent Blog:
[CaRP] XML error: Invalid character at line 55
 
Join Date: Jan 2007
Location: Dublin
Posts: 416
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
ziycon will become famous soon enough
Send a message via MSN to ziycon Send a message via Skype™ to ziycon
Default

PHP Code:
if($fname)
{
      
$fname "Name: $fname";
      
$msg .= "$fname\n";
}
else
{
      
$error "- Name Missing.<br>\n";
}
if(
$email)
{
      
$email "E-Mail: $email";
      
$msg .= "$email\n";
}
else
{
      
$error .= "- E-Mail Missing.<br>\n";
}
if(
$subject)
{
      
$subject "Subject: $subject";
      
$msg .= "$subject\n";
}
else
{
      
$error .= "- Subject Missing.<br>\n";
}
if(
$message)
{
      
$message "Message: $message";
      
$msg .= "$message\n";
}
else
{
      
$error .= "- Message Missing.<br>\n";
}
if(
$error == "")
{
      echo
'Thank you for contacting Us.';
      
mail("info@site.com""$subject"$msg"From: $email");
      
mail($email"Confirmation""Your message has been sent.\n\nThank you for contacting us.\ninfo@site.com""From: noreply@site.com");
}
else
{
      print 
"Please fill in the missing fields - <br>\n";
      print 
"$error<br>\n";
      print 
"<br>\n";
      print 
"<br>\n";
      print 
"Please use your \"Back\" button to return to the form to correct the omissions.<br>\n";

Reply With Quote