azuredesign Posted November 26, 2007 Share Posted November 26, 2007 I'm still new to PHP, so excuse my ignorance... I am trying to get user's input on a form, send the form information to myself in an email, and then send the user and email to their inputted email address. This is the code I have, not sure what I'm doing wrong??!?!? <?php $message = "Here is a Sign Change " . "\n\n"; $message = $message . "Submission Date and Time: " . date("l dS of F Y h:i:s A") . "\n"; $message = $message . "Customer Name: " . $_REQUEST['CustName'] . "\n"; $message = $message . "Contact Name: " . $_REQUEST['ContactName'] . "\n"; $message = $message . "Phone Number: " . $_REQUEST['Phone'] . "\n" . "\n"; $message = $message . "Email Address: " . $_REQUEST['EmailAddress'] . "\n" . "\n"; $message = $message . "Requested Change Date: " . $_REQUEST['ChangeDate'] . "\n" . "\n"; $message = $message . "Additional Comments: " . $_REQUEST['Comments'] . "\n" . "\n"; $message = $message . $_REQUEST['EmailSubmission']; // In case any of our lines are larger than 70 characters, we should use wordwrap() $message = wordwrap($message, 70); // Send to impact signs and insert headers and subject $email = "joewiebe@gmail.com"; $subject = "Here is a sign change email!"; $header = "From: WebEmail\r\n" // Compile info and send to submitter mail($email,$subject,$message,$header); $message = "Thank you for submitting a form"; $email = $_POST["EmailAddress"] $subject = "Thank you for your submission"; $header = "From: impact_signs@mts.net\n" // Compile info and send to submitter mail($email,$subject,$message,$header); // redirect back to url visitor came from header('location:home.php'); ?>ß Quote Link to comment Share on other sites More sharing options...
teng84 Posted November 26, 2007 Share Posted November 26, 2007 whats the error message? or try this link http://www.w3schools.com/php/func_mail_mail.asp Quote Link to comment Share on other sites More sharing options...
azuredesign Posted November 26, 2007 Author Share Posted November 26, 2007 There is no error message, just the mail is never sent... the redirect doesnt work either, just shows a blank white page. Quote Link to comment Share on other sites More sharing options...
teng84 Posted November 26, 2007 Share Posted November 26, 2007 <?php $message = "Here is a Sign Change " . "\n\n"; $message = $message . "Submission Date and Time: " . date("l dS of F Y h:i:s A") . "\n"; $message = $message . "Customer Name: " . $_REQUEST['CustName'] . "\n"; $message = $message . "Contact Name: " . $_REQUEST['ContactName'] . "\n"; $message = $message . "Phone Number: " . $_REQUEST['Phone'] . "\n" . "\n"; $message = $message . "Email Address: " . $_REQUEST['EmailAddress'] . "\n" . "\n"; $message = $message . "Requested Change Date: " . $_REQUEST['ChangeDate'] . "\n" . "\n"; $message = $message . "Additional Comments: " . $_REQUEST['Comments'] . "\n" . "\n"; $message = $message . $_REQUEST['EmailSubmission']; $message = wordwrap($message, 70); $email = "joewiebe@gmail.com"; $subject = "Here is a sign change email!"; $header = "From: WebEmail\r\n"; mail($email,$subject,$message,$header); $message = "Thank you for submitting a form"; $email = $_POST["EmailAddress"] ; $subject = "Thank you for your submission"; $header = "From: impact_signs@mts.net\n" ; if(mail($email,$subject,$message,$header)){ header('location:home.php'); exit; } else{ echo 'failed'; } ?> try.. no error message? maybe your error reporting is off... because actually i saw 4 errors in your script Quote Link to comment Share on other sites More sharing options...
azuredesign Posted November 26, 2007 Author Share Posted November 26, 2007 tried that, it still did not work. im not sure why errors weren't spotted. i tried purposely screwing it up, then it reported errors, but not with my original code, or yours Quote Link to comment Share on other sites More sharing options...
redarrow Posted November 26, 2007 Share Posted November 26, 2007 try now <?php $message = "Here is a Sign Change " . "\n\n"; $message = $message . "Submission Date and Time: " . date("l dS of F Y h:i:s A") . "\n"; $message = $message . "Customer Name: " . $_REQUEST['CustName'] . "\n"; $message = $message . "Contact Name: " . $_REQUEST['ContactName'] . "\n"; $message = $message . "Phone Number: " . $_REQUEST['Phone'] . "\n" . "\n"; $message = $message . "Email Address: " . $_REQUEST['EmailAddress'] . "\n" . "\n"; $message = $message . "Requested Change Date: " . $_REQUEST['ChangeDate'] . "\n" . "\n"; $message = $message . "Additional Comments: " . $_REQUEST['Comments'] . "\n" . "\n"; $message = $message . $_REQUEST['EmailSubmission']; $message = wordwrap($message, 70); $email = "joewiebe@gmail.com"; $subject = "Here is a sign change email!"; $header = "From: WebEmail\r\n"; mail($email,$subject,$message,$header); $message = "Thank you for submitting a form"; $email = $email ; $subject = "Thank you for your submission"; $header = "From: impact_signs@mts.net\n" ; if(mail($email,$subject,$message,$header)){ header('location:home.php'); exit; } else{ echo 'failed'; } ?> Quote Link to comment Share on other sites More sharing options...
azuredesign Posted November 26, 2007 Author Share Posted November 26, 2007 still no luck... would it help if i showed you my form? Quote Link to comment Share on other sites More sharing options...
teng84 Posted November 26, 2007 Share Posted November 26, 2007 yes.. Quote Link to comment Share on other sites More sharing options...
azuredesign Posted November 27, 2007 Author Share Posted November 27, 2007 ok well it is located at http://impactsigns.net/template.php Quote Link to comment Share on other sites More sharing options...
redarrow Posted November 27, 2007 Share Posted November 27, 2007 are all the varables from the form posting mate cheek....... if($_POST['z']){ echo $z; } Quote Link to comment Share on other sites More sharing options...
azuredesign Posted November 27, 2007 Author Share Posted November 27, 2007 not quite sure what i'm to do with that... but still no luck Quote Link to comment Share on other sites More sharing options...
teng84 Posted November 27, 2007 Share Posted November 27, 2007 please try the link i gave you... Quote Link to comment Share on other sites More sharing options...
azuredesign Posted November 27, 2007 Author Share Posted November 27, 2007 well, i thank you all for your help at this point, but i've found out the server pulled the plug on supporting this. i tested it on another server, and it worked fine... thank you very much... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.