Hi, I am new to the site, but I am currently trying to build an information form so that customers can submit some information via email to me, sort of like a contact form but with some other information on it. I have been checking my code over and over but the form does not seem to work, when you click submit, it just takes you to a blank page! even though I specified a "success" page link. here is what the code look like: (I would truly appreciate it if someone could take a look and let me know what I am doing wrong, thank you all so much! ;) )... this is the link to the form I'm working on: http://www.butelconstruction.com/paymentform.html


$EmailFrom = Trim(stripslashes($_POST['EmailFrom'])); 
$EmailTo = "vitalsales@sbcglobal.net";
$Subject = "Payment form";
$FirstName = Trim(stripslashes($_POST['FirstName'])); 
$LastName = Trim(stripslashes($_POST['LastName'])); 
$Invoicenumber = Trim(stripslashes($_POST['Invoicenumber'])); 
$creditcardnumber = Trim(stripslashes($_POST['creditcardnumber']))
$Expirationdate = Trim(stripslashes($_POST['Expirationdate']))
$cid = Trim(stripslashes($_POST['cid']))
$Address = Trim(stripslashes($_POST['Address'])); 
$City = Trim(stripslashes($_POST['City'])); 
$State = Trim(stripslashes($_POST['State'])); 
$Zip = Trim(stripslashes($_POST['Zip'])); 
$Phone = Trim(stripslashes($_POST['Phone'])); 

// validation
if (Trim($EmailFrom)=="") $validationOK=false;
if (Trim($FirstName)=="") $validationOK=false;
if (Trim($LastName)=="") $validationOK=false;
if (Trim($Invoicenumber)=="") $validationOK=false;
if (Trim($creditcardnumber)=="") $validationOK=false;
if (Trim($Expirationdate)=="") $validationOK=false;
if (Trim($cid)=="") $validationOK=false;
if (Trim($Phone)=="") $validationOK=false;
if (!$validationOK) {
  print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";

// prepare email body text
$Body = "";
$Body .= "FirstName: ";
$Body .= $FirstName;
$Body .= "\n";
$Body .= "LastName: ";
$Body .= $LastName;
$Body .= "\n";
$Body .= "Invoicenumber";
$Body .= $Invoicenumber
$Body .="\n";
$Body .= "creditcardnumber";
$Body .= $creditcardnumber
$Body .= "\n";
$Body .= "Expirationdate"
$Body .= $Expirationdate
$Body .= "\n";
$Body .= "cid";
$Body .= $cid
$Body .= "\n";
$Body .= "Address: ";
$Body .= $Address;
$Body .= "\n";
$Body .= "City: ";
$Body .= $City;
$Body .= "\n";
$Body .= "State: ";
$Body .= $State;
$Body .= "\n";
$Body .= "Zip: ";
$Body .= $Zip;
$Body .= "\n";
$Body .= "Phone: ";
$Body .= $Phone;
$Body .= "\n";

// send email 
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");

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

8 Years
Discussion Span
Last Post by death_oclock

Submit takes me to payment.php, which doesn't exist. What file is the code you provided supposed to be for? At any rate, this is not a PHP issue.


Hi, thank's for your reply, the file payment.php is uploaded to the server, which is why I'm confused, everything seems like it should be working, I don't know what I am doing wrong :(


If "payment.phm" isn't a typo, then its the problem. Check the filename. Otherwise, is payment.php in the same directory as paymentform.html?

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.