All pastes #837798 Raw Edit

mawst

public text v1 · immutable
#837798 ·published 2007-12-29 22:39 UTC
rendered paste body
<?php

   error_reporting(E_ALL) 
  $info = $_POST['Name'];
  $info .= " has sent you message via the BadFellaz contact form.\n";
  $info .= "You may contact this person via E-mail at: $Address.\n";
  $info .= "The message is as follows:\n\n";
  $_POST['Message'] = stripslashes($_POST['Message']); //Make it look neat.
  $info .= $_POST['Message']; // may need \n\n here at end.


  //The following three lines will need to be changed to the correct information.
  $send_to = "m4w57@yahoo.com";
  $subject =  $_POST['Regarding']; //Subject of E-mail
  $description = "Fix My PC MPLS"; //You can use this if you run the script on multiple sites, and would like to distinguish what site the form has been submitted from before opening the e-mail.
  $website = "http://www.fixmypcmpls.co.nr/"; //Is this needed?

  // Additional headers
  $headers = "From: Quote Request \n";
  $headers .= "Reply-To:";
  $headers .= $_POST['Address'];
  $headers .= "\n\n";

  if (!isset($subject)) {
   exit;
}
  
  //Finally, we send the message.
  $send = mail($send_to, $subject, $info, $headers);
  if($send == 1)
  {
  //The message was sent without errors.
   echo "<meta http-equiv=\"refresh\" content=\"0;URL=";
   echo("success.php"); //Change this to the url of the success message.
   echo "?Name=";
	echo $_POST['Name'];
	echo "\">";
   exit;
  }
  else
  //There was some sort of problem sending the message. Redirect to an error document.
   echo "<meta http-equiv=\"refresh\" content=\"0;URL=";
   echo("failure.php");
   echo "?Name=";
	echo $_POST['Name'];
	echo "\">";
   exit; 
?>