mrebeler87 Posted August 17, 2013 Share Posted August 17, 2013 I receive the email just fine but when I do I don't get any info. What am I missing? <?php $email = $_POST['email']; $first = $_POST['first']; $last = $_POST['last']; $business = $_POST['business']; $home = $_POST['home']; $cell = $_POST['cell']; $other = $_POST['other']; $street = $_POST['street']; $city = $_POST['city']; $state = $_POST['state']; $zip = $_POST['zip']; $con_time = $_POST['con_time']; $cameras = $_POST['cameras']; $quality = $_POST['quality']; $monitor = $_POST['monitor1']; $monitor = $_POST['monitor2']; $monitor = $_POST['monitor3']; $monitor = $_POST['monitor4']; $monitor = $_POST['monitor5']; $to = 'sales@landb-securities.com'; $subject = ' Sales Request ' ; $message = " Conact Name: Name: $first $last Business Name: $business Conact Numbers: Home: $home Cell: $cell Other: $other Preferred Contact time: $con_time Address: Street Address: $street City: $city State: $state Zipcode: $zip The customer is interested in $cameras at $quality and wants to monitor it via $monitor1,$monitor2,$monitor3,$monitor4,$monitor5. \r\n"; $headers = 'From: ' .$email . "\r\n" . 'Reply-To: ' .$email . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); echo "Thank You, Your request has been sent.<br> <br>"; echo "<a href=\"http://landb-securities.com\"> Back to Home Page </a>"; ?> Quote Link to comment Share on other sites More sharing options...
jazzman1 Posted August 17, 2013 Share Posted August 17, 2013 (edited) The first thing, you should have to do before sending any data, is to check the values of every POST request. var_dump($_POST) is a very good debugging php function. Edited August 17, 2013 by jazzman1 Quote Link to comment Share on other sites More sharing options...
hakimserwa Posted August 17, 2013 Share Posted August 17, 2013 replace this for your $message $message = <<<MAILBODY Name: {$first $last} Business Name: {$business} Conact Numbers: Home: {$home} Cell: {$cell} Other: {$other} Preferred Contact time: {$con_time} Address: Street Address: {$street} City: {$city} State: {$state} Zipcode: {$zip} MAILBODY; Quote Link to comment Share on other sites More sharing options...
jazzman1 Posted August 17, 2013 Share Posted August 17, 2013 @hakim, please don't provide wrong or useless solutions! Here isn'a a children's place. It's a help forum. Also, check at docs where and how you can use curly braces in the scripts. Quote Link to comment Share on other sites More sharing options...
hakimserwa Posted August 17, 2013 Share Posted August 17, 2013 (edited) @hakim, please don't provide wrong or useless solutions! Here isn'a a children's place. It's a help forum. Also, check at docs where and how you can use curly braces in the scripts. if you dont know ask you are ashaming the guru tag. check the code if it gives any error report the error. by the way what was your solution to the problem? you could not even see that the guy's $message was not set. by the way those {} are called inline substitution. call it a day you lernt something new. Edited August 17, 2013 by hakimserwa Quote Link to comment Share on other sites More sharing options...
jazzman1 Posted August 17, 2013 Share Posted August 17, 2013 (edited) if you dont know ask you are ashaming the guru tag. Nobody asked me whether I wanna be a guru at phpfreaks.com.It was just a guru(mod) community decision.It does not matter for me to be or not a guru at all. I just wanna provide my help. it gives any error report the error. by the way what was your solution to the problem? Yes, he could put the error_reporting() function on the top of the page, but var_dump() is a good solution too. you could not even see that the guy's $message was not set. No, the message has been sent with empty values! by the way those {} are called inline substitution. call it a day you lernt something new. It's not really necessary to use curly braces or heredoc here, but if you want it, you should aware that all braces expansion are performed before any other expansions, and any characters special to other expansions are preserved in the result. That's why, you cannot have more then one variable, like { $var1 $var2 } outside of a function or just for "for", "while", "foreach" looping constructs. If you're using some IDE, you will get a syntax error! Edited August 17, 2013 by jazzman1 Quote Link to comment Share on other sites More sharing options...
jcbones Posted August 17, 2013 Share Posted August 17, 2013 I see the $message in the OP, changing a double quoted string to a heredoc is not really a help in this situation IMHO (unless I am totally missing something). I would go back to Jazzman's post and say var_dump the incoming $_POST to make sure you have the index names right. Quote Link to comment Share on other sites More sharing options...
mrebeler87 Posted August 17, 2013 Author Share Posted August 17, 2013 Hey guys thanks so much for replying. Long story short but I forgot to name all my inputs and I forgot to give value to my radios *facepalm* its sends just fine now but I will add in var dump to verify value as well. Thanks again guys/gals.. yall have a good one 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.