m@ Posted September 27, 2003 Posted September 27, 2003 alright, my problem is simple, i have this code: <?php ini_set("display_errors", 1); $firstname=$_POST['First Name']; $lastname=$_POST['Last Name']; $address=$_POST['Address']; $city=$_POST['city']; $state=$_POST['state']; $zipcode=$_POST['zipcode']; $phonepart1=$_POST['Phone Area Code']; $phonepart2=$_POST['Phone Number Part 2']; $phonepart3=$_POST['Phone Number Part 3']; $email=$_POST['email']; $creditcardnumber=$_POST['Credit Card Number']; $month=$_POST['month']; $day=$_POST['Day']; $year=$_POST['Expiration Year']; mail("mjw136@hotmail.com", "You have recieved an order!!", "First Name: $firstname\n Last Name: $lastname\n Address: $address\n City: $city\n State: $state\n ZipCode: $zipcode\n Phone: $phonepart1 - $phonepart2 - $phonepart3\n E-mail: $email\n Credit Card Number: $creditcardnumber\n Expiration Date: $month - $day - $year"); ?> and its not working, i think it might be the server
Sayonara Posted September 27, 2003 Posted September 27, 2003 Try assembling the headers and body before you stick them into your mail() function, then tell us what happened.
m@ Posted September 27, 2003 Author Posted September 27, 2003 now ive got this: <html> <head> </head> <body> <?php ini_set("display_errors", 1); $firstname=$_POST['First Name']; $lastname=$_POST['Last Name']; $address=$_POST['Address']; $city=$_POST['city']; $state=$_POST['state']; $zipcode=$_POST['zipcode']; $phonepart1=$_POST['Phone Area Code']; $phonepart2=$_POST['Phone Number Part 2']; $phonepart3=$_POST['Phone Number Part 3']; $email=$_POST['email']; $creditcardnumber=$_POST['Credit Card Number']; $month=$_POST['month']; $day=$_POST['Day']; $year=$_POST['Expiration Year']; mail("mjw136@hotmail.com", "You have recieved an order!!", "First Name: $firstname\n Last Name: $lastname\n Address: $address\n City: $city\n State: $state\n ZipCode: $zipcode\n Phone: $phonepart1 - $phonepart2 - $phonepart3\n E-mail: $email\n Credit Card Number: $creditcardnumber\n Expiration Date: $month - $day - $year"); ?> </body> </html> Is that what you meant? im not sure, please edit if you need
Sayonara Posted September 27, 2003 Posted September 27, 2003 Do it like this: $subject = "You have recieved an order"; $from_email = $_POST['from_email']; $to_email = "mjw136@hotmail.com"; $message = // put together your body text here rather than in the mail() function itself $headers = (string) "From:" . $from_email . "\r\n"; mail($to_email, $subject, $message, $headers);
Dudde Posted September 28, 2003 Posted September 28, 2003 I curse you all to hell for knowing programming
m@ Posted September 28, 2003 Author Posted September 28, 2003 heheheh dudde ok so i am assuming im not to include (string)
m@ Posted September 28, 2003 Author Posted September 28, 2003 i also cant remember if u have to put <?php and ?> in.
Sayonara Posted September 28, 2003 Posted September 28, 2003 The (string) is optional. Your PHP server should be able to work out that variable is a string just by what's in it. If you don't surround your PHP code with correct opening and closing tags, obviously it won't be processed by the server. Did that lot work?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now