jlaperch Posted December 2, 2008 Share Posted December 2, 2008 I had this code done for me...for a client....but the most important part is not working...it is supposed to email the form to an email address but it doesn't...the variables for the email are at the end...any help is much appreciated...have a huge deadline <?php if(!empty($_REQUEST['attn']) && $_REQUEST['attn']=='signup') { $to="andy@clayarc.com"; $attn=$_REQUEST['attn']; $ip=getenv("REMOTE_ADDR"); $custtype=$_REQUEST['custtype']; $bizname=$_REQUEST['bizname']; $name=$_REQUEST['name']; $address=$_REQUEST['address']; $city=$_REQUEST['city']; $zip=$_REQUEST['zip']; $email=$_REQUEST['email']; $utility_name=$_REQUEST['utility_name']; $utility_number=$_REQUEST['utility_number']; $pod_number=$_REQUEST['pod_number']; $name_key=$_REQUEST['name_key']; $meterday=$_REQUEST['meterday']; $phone=$_REQUEST['phone']; $fax=$_REQUEST['fax']; $referral=$_REQUEST['referral']; $position=$_REQUEST['position']; $sig=$_REQUEST['sig']; $message = "From: $name ($email)\n Customer Type: $custtype \n Legal Company Name: $bizname \n Your Name: $name \n Street Address: $address \n City: $city \n Zip Code: $zip \n Email Address: $email \n Current Distribution Provider: $utility_name \n Account Number: $utility_number \n POD Number: $pod_number \n Name Key: $name_key \n Meter Read Date: $meterday \n Phone Number: $phone \n Fax Number: $fax \n Referred By: $referral \n Position: $position \n E-Signature: $sig \n Additional Info : IP = $ip \n "; $from = "From: $name ($email)\r\n"; if(mail($to=jlaperch@charter.net; $subject, $message, $from)) @header("location:thanks.php"); else @header("location:index.php"); } ?> Quote Link to comment Share on other sites More sharing options...
flyhoney Posted December 2, 2008 Share Posted December 2, 2008 Change: <?php $from = "From: $name ($email)\r\n"; if(mail($to=jlaperch@charter.net; $subject, $message, $from)) @header("location:thanks.php"); else @header("location:index.php"); } ?> to: <?php $from = "From: $name ($email)\r\n"; if (mail($to = 'jlaperch@charter.net'; $subject, $message, $from)) { @header("location:thanks.php"); } else { @header("location:index.php"); } ?> Quote Link to comment Share on other sites More sharing options...
jlaperch Posted December 2, 2008 Author Share Posted December 2, 2008 what are the variables up top for...of my original code...seems like that is where i need to make the change but that does not work...nor does your code is this a server thing? thanks john Quote Link to comment Share on other sites More sharing options...
DeanWhitehouse Posted December 2, 2008 Share Posted December 2, 2008 First off provide more info and don't have the title "Need a quick fix" we are here to help, but we do not profit from it so don't expect people to help you because you need a quick fix. Look at this and learn about headers for the mail function http://uk2.php.net/manual/en/function.mail.php Your code slightly improved <?php error_reporting(E_ALL); if(!empty($_REQUEST['attn']) && $_REQUEST['attn']=='signup') { $to="andy@clayarc.com"; $attn=$_REQUEST['attn']; $ip=getenv("REMOTE_ADDR"); $custtype=$_REQUEST['custtype']; $bizname=$_REQUEST['bizname']; $name=$_REQUEST['name']; $address=$_REQUEST['address']; $city=$_REQUEST['city']; $zip=$_REQUEST['zip']; $email=$_REQUEST['email']; $utility_name=$_REQUEST['utility_name']; $utility_number=$_REQUEST['utility_number']; $pod_number=$_REQUEST['pod_number']; $name_key=$_REQUEST['name_key']; $meterday=$_REQUEST['meterday']; $phone=$_REQUEST['phone']; $fax=$_REQUEST['fax']; $referral=$_REQUEST['referral']; $position=$_REQUEST['position']; $sig=$_REQUEST['sig']; $message = "From: $name ($email)\n Customer Type: $custtype \n Legal Company Name: $bizname \n Your Name: $name \n Street Address: $address \n City: $city \n Zip Code: $zip \n Email Address: $email \n Current Distribution Provider: $utility_name \n Account Number: $utility_number \n POD Number: $pod_number \n Name Key: $name_key \n Meter Read Date: $meterday \n Phone Number: $phone \n Fax Number: $fax \n Referred By: $referral \n Position: $position \n E-Signature: $sig \n Additional Info : IP = $ip \n "; $from = "From: $name ($email)\r\n"; if(mail($to=jlaperch@charter.net; $subject, $message, $from)) header("location:thanks.php"); else header("location:index.php"); } ?> what are the variables up top for...of my original code...seems like that is where i need to make the change but that does not work...nor does your code You did write this code? If not then don't use it if you don't understand it. Here is a tutorial using php mail as a contact form http://djw-webdesign.awardspace.com/code.php?snippet=10 Quote Link to comment Share on other sites More sharing options...
flyhoney Posted December 2, 2008 Share Posted December 2, 2008 There was a typo in my code <?php $from = "From: $name ($email)\r\n"; if (mail($to = 'jlaperch@charter.net', $subject, $message, $from)) { @header("location:thanks.php"); } else { @header("location:index.php"); } ?> Also, turn error reporting on by placing the following at the top of your script: <?php // Report all PHP errors error_reporting(E_ALL); // Same as error_reporting(E_ALL); ini_set('error_reporting', E_ALL); ?> Quote Link to comment Share on other sites More sharing options...
jlaperch Posted December 2, 2008 Author Share Posted December 2, 2008 listen i want to understand and i didn't mean to piss anyone off...if i am using the wrong forum i'm sorry... how should i have written this up.. not trying to be a jerk i actually paid someone from this forum to help me...so not looking for free work...but he is not around and i am on deadline Quote Link to comment Share on other sites More sharing options...
DeanWhitehouse Posted December 2, 2008 Share Posted December 2, 2008 You don't need to do <?php // Report all PHP errors error_reporting(E_ALL); // Same as error_reporting(E_ALL); ini_set('error_reporting', E_ALL); ?> They are both the same things you only need to use one listen i want to understand and i didn't mean to piss anyone off...if i am using the wrong forum i'm sorry... how should i have written this up.. not trying to be a jerk i actually paid someone from this forum to help me...so not looking for free work...but he is not around and i am on deadline Look at the tutorial link i posted, and learn PHP and fix the code. I have posted some modifications to show if there are any errors but there could be a number of things wrong, otherwise post in the freelance section asking for someone to write it for you. Quote Link to comment Share on other sites More sharing options...
flyhoney Posted December 2, 2008 Share Posted December 2, 2008 Yikes! My bad, I was being careless. I meant: <?php error_reporting(E_ALL); ini_set('display_errors', TRUE); ?> Quote Link to comment Share on other sites More sharing options...
trq Posted December 2, 2008 Share Posted December 2, 2008 This line.... if (mail($to = 'jlaperch@charter.net', $subject, $message, $from)) { Needs to be.... if (mail('jlaperch@charter.net', $subject, $message, $from)) { Quote Link to comment Share on other sites More sharing options...
flyhoney Posted December 2, 2008 Share Posted December 2, 2008 Wow, I'm losing my mind. That's what I meant to type, twice. Quote Link to comment Share on other sites More sharing options...
revraz Posted December 2, 2008 Share Posted December 2, 2008 I'm also going to wager the FROM entry will fail if you don't use a FROM: email that is on your domain. Quote Link to comment Share on other sites More sharing options...
jlaperch Posted December 2, 2008 Author Share Posted December 2, 2008 thanks working now ...sorry i was using the board wrong 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.