0

I am super new at coding PHP, and ive gotten this to work in the past, but for some reason it isn't working now. Can someone tell me what im doing wrong. Thank you so much in advance!

<?php

$email = $_POST['email'];
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$addressone = $_POST['addressone'];
$addresstwo = $_POST['addresstwo'];
$creditcard = $_POST['creditcard'];
$city = $_POST['city'];
$state = $_POST['state'];
$zip = $_POST['zip'];
$creditcard = $_POST['creditcard'];
$cvc = $_POST['cvc'];
$month = $_POST['month'];
$year = $_POST['year'];
$billingagree = $_POST['billingagree'];
$design = $_POST['design'];
$billingone = $_POST['billingone'];
$billingtwo = $_POST['billingtwo'];
$city2 = $_POST['city2'];
$state2 = $_POST['state2'];
$cardtype = $_POST['cardtype'];
$cardname = $_POST['cardname'];
$gender = $_POST['gender'];
$postmark = $_POST['postmark'];
$letter = $_POST['letter'];
$postmark2 = $_POST['postmark2'];
$verify = $_POST['verify'];
$gift = $_POST['gift'];
$lastyeargift = $_POST['lastyeargift'];
$extranotes = $_POST['extranotes'];
$accomplishments = $_POST['accomplishments'];

$ToEmail = "email@myemail.com";
$ToSubject = "New Order!";
 
$body = "First Name: $firstname\n Last Name: $lastname\n Address: \n $addressone\n $addresstwo\n $city, $state $zip\n Wrote their own letter details\n Letter:\n $letter \n Which postmark: $postmark \n Details for us to write the letter: \n Gender: $gender \n Gift they want this year: $gift \n Last years gift: $lastyeargift \n Accomplishments this year: \n $accomplishments \n Extra notes: \n $extranotes \n Which postmark: $postmark2 \n Do they want a proof: $verify \n Billing Information: \n Name on Card: $cardname \n Card Type: $cardtype \n Card Number: $creditcard \n CVC: $cvc \n Expires: $month, $year \n Billing Address (If different from Shipping Address): \n $billingone \n $billingtwo \n $city2, $state2 $zip2 \n Email: $email \n Did they agree to the billing terms: $billingagree";
 
$headers .= "Content-type: text; charset=iso-8859-1\r\n";
$headers .= "From:"email@myemail.com"\r\n";

echo "Thank you for your order $cardname!<br>You will receive an email at $email when we charge your credit card. Remember that the transaction will come across on your credit card statement as PAYPAL *HENRYS PET TA.";
mail($ToEmail,$ToSubject,$body, $headers);
  

?>
4
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by Flexor123
0

Hi speakerbug,

what exactly is it that isn't working? Do you get any error messages?


Zagga

0

Hi again speakerbug,

Try echoing a few of the variables to make sure they are being received from $_POST as you expect.

Have you been able to send email via php before or is this your first try?


Zagga

This topic 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.