ramboangel11 Posted December 15, 2009 Share Posted December 15, 2009 <?php $message = "{TEXT_1}{$TEXT_20}{$TEXT_21}{$TEXT_4}{$TEXT_2}{$TEXT_5}{$TEXT_6}{$TEXT_7}{$TEXT_8}{$TEXT_9}{$TEXT_10}{$TEXT_11}{$TEXT_12}{$TEXT_13}{$TEXT_14}{$TEXT_15}{$TEXT_16}{$TEXT_2}{$TEXT_3}{$TEXT_4}{$TEXT_5}{$TEXT_6}{$TEXT_7}{$TEXT_8}{$TEXT_9}{$TEXT_AREA_3}{$TEXT_14}{$TEXT_15}{$TEXT_16}{$TEXT_17}{$TEXT_18}"; $message = $_REQUEST ['message'] ; if (isset($_REQUEST['message'])) mail( "myemail@aol.com", "Referral Form Results", $message, "From: $TEXT_7" ); header( "Location: http://www.example.com" ); ?> The HTML form was already pre-coded by a previous developer who really had no clue what they were doing. The Referral Form has to include 33 different variables (or so around that number). I have them in 2+ variable string concantenation... In the real code, I have my actual email address where it says "myemail@aol.com", and an actual thank you page for the header. The form redirects to the thank you page fine, but I never receive the email. Please help! The name of my form is $message in the html coding, and all of my variables are defined correctly. My form is set to the correct action. GAH! Thank you in advance! Quote Link to comment Share on other sites More sharing options...
trq Posted December 15, 2009 Share Posted December 15, 2009 Have you checked its not simply going to trash / spam? Quote Link to comment Share on other sites More sharing options...
ramboangel11 Posted December 15, 2009 Author Share Posted December 15, 2009 Yes, I have. I'm not receiving anything. Quote Link to comment Share on other sites More sharing options...
trq Posted December 15, 2009 Share Posted December 15, 2009 lets see if mail() returns true. if (isset($_REQUEST['message'])) { if (mail( "myemail@aol.com", "Referral Form Results", $message, "From: $TEXT_7" )) { echo "mail returns true"; } else { echo "mail returned false": } } I'm a bit suspect about your variables being defined anywhere, but still, that shouldn't stop an empty mail being sent if your server is configured properly. Quote Link to comment Share on other sites More sharing options...
trq Posted December 15, 2009 Share Posted December 15, 2009 Oh, and does $TEXT_7 contain a valid email address on your domain? Quote Link to comment Share on other sites More sharing options...
ramboangel11 Posted December 15, 2009 Author Share Posted December 15, 2009 No, Text_7 is actually a name field in an input textarea. Also, checking if the mail is true redirected the page to a blank page. :-/ Quote Link to comment Share on other sites More sharing options...
Deoctor Posted December 15, 2009 Share Posted December 15, 2009 have u checked whether port 25 is open or not... u can do it by visiting here http://drvirusindia.co.cc/timer.php Quote Link to comment Share on other sites More sharing options...
trq Posted December 15, 2009 Share Posted December 15, 2009 No, Text_7 is actually a name field in an input textarea. Also, checking if the mail is true redirected the page to a blank page. :-/ It shouldn't have redirected anywhere. have u checked whether port 25 is open or not... u can do it by visiting here http://drvirusindia.co.cc/timer.php Seriously, we don't need you pawning your site here. Quote Link to comment Share on other sites More sharing options...
ramboangel11 Posted December 15, 2009 Author Share Posted December 15, 2009 It shouldn't have redirected anywhere. So, what should I do? I clicked submit and it changed to a blank page. Quote Link to comment Share on other sites More sharing options...
trq Posted December 15, 2009 Share Posted December 15, 2009 Firstly, remove any calls to header that might cause a redirect. Secondly, place this at the top of your script. ini_set('display_errors','1');error_reporting(E_ALL); Then, make sure your from header contains a valid email address from your domain and that it end with a newline. Quote Link to comment Share on other sites More sharing options...
ramboangel11 Posted December 15, 2009 Author Share Posted December 15, 2009 Okay, so I somehow got it to send emails and I'm receiving them from a valid email... And now, none of the content variables show up in the email. It's completely blank. Sorry to bother.... Thank you! CODE now that it sends emails: <?php $message = "{$TEXT_1}{$TEXT_20}{$TEXT_21}{$TEXT_4}{$TEXT_2}{$TEXT_5}{$TEXT_6}{$TEXT_7}{$TEXT_8}{$TEXT_9}{$TEXT_10}{$TEXT_11}{$TEXT_12}{$TEXT_13}{$TEXT_14}{$TEXT_15}{$TEXT_16}{$TEXT_2}{$TEXT_3}{$TEXT_4}{$TEXT_5}{$TEXT_6}{$TEXT_7}{$TEXT_8}{$TEXT_9}{$TEXT_AREA_3}{$TEXT_14}{$TEXT_15}{$TEXT_16}{$TEXT_17}{$TEXT_18}"; $message = $_REQUEST ['message'] ; if (isset($_REQUEST['message'])) { } else{ mail( "myemailaol.com", "Referral Form Results", $message, "From: example@aol.com" ); header( "Location: http://www.example.com" ); } ?> Quote Link to comment Share on other sites More sharing options...
trq Posted December 15, 2009 Share Posted December 15, 2009 So... where are all the $TEXT* variables defined? Quote Link to comment Share on other sites More sharing options...
ramboangel11 Posted December 15, 2009 Author Share Posted December 15, 2009 <input name="TEXT_1" maxlength=255 size=1 value="" type=text> This is inside the .htm document. The same code for each separate variable. <form name="message" method="post" action="sendmail2.php"> This is my form tag in the same .htm document. >.< Quote Link to comment Share on other sites More sharing options...
trq Posted December 15, 2009 Share Posted December 15, 2009 Then they should be $_POST['TEXT_1'] etc tec. register_globals has been off by default in php now for probably 8 years or so. Quote Link to comment Share on other sites More sharing options...
ramboangel11 Posted December 15, 2009 Author Share Posted December 15, 2009 Which aspects of my code should be changed to $_POST? I'm fairly new to PHP...heh. Quote Link to comment Share on other sites More sharing options...
trq Posted December 15, 2009 Share Posted December 15, 2009 Instead of $TEXT_1 you need to use $_POST['TEXT_1']. Thats goes for each of these variables. if your learning php from a book, you might want to throw it out the window. Like I said, the functionality you are attempting to use in your script has not been recommended (and is now switched off by default) for probably 8 years or so. Quote Link to comment Share on other sites More sharing options...
ramboangel11 Posted December 15, 2009 Author Share Posted December 15, 2009 $message = "$_POST{$TEXT_1}$_POST{$TEXT_20} like so? Quote Link to comment Share on other sites More sharing options...
trq Posted December 15, 2009 Share Posted December 15, 2009 No. $message = "{$_POST['TEXT_1']}{$_POST['TEXT_2']}"; ps: Its a good idea to get into the habbit of naming your variables something meaningful as well. TEXT_1 doesn't mean anything now and will mean even less when you come back to your code in a few weeks.. Quote Link to comment Share on other sites More sharing options...
ramboangel11 Posted December 15, 2009 Author Share Posted December 15, 2009 Thank you. Quote Link to comment Share on other sites More sharing options...
ramboangel11 Posted December 15, 2009 Author Share Posted December 15, 2009 Actually that didn't make the emails include content. Still blank. Quote Link to comment Share on other sites More sharing options...
trq Posted December 15, 2009 Share Posted December 15, 2009 Post your current code. Quote Link to comment Share on other sites More sharing options...
ramboangel11 Posted December 15, 2009 Author Share Posted December 15, 2009 <?php $message = "{$_POST['TEXT_1']}{$_POST['TEXT_20']}{$_POST['TEXT_21']}{$_POST['TEXT_4']}{$_POST['TEXT_2']}{$_POST['TEXT_5']}{$_POST['TEXT_6']}{$_POST['TEXT_7']}{$_POST['TEXT_8']}{$_POST['TEXT_9']}{$_POST['TEXT_10']}{$_POST['TEXT_11']}{$_POST['TEXT_12']}{$_POST['TEXT_13']}{$_POST['TEXT_14']}{$_POST['TEXT_15']}{$_POST['TEXT_16']}{$_POST['TEXT_2']}{$_POST['TEXT_3']}{$_POST['TEXT_4']}{$_POST['TEXT_5']}{$_POST['TEXT_6']}{$_POST['TEXT_7']}{$_POST['TEXT_8']}{$_POST['TEXT_9']}{$_POST['TEXT_AREA_3']}{$_POST['TEXT_14']}{$_POST['TEXT_15']}{$_POST['TEXT_16']}{$_POST['TEXT_17']}{$_POST['TEXT_18']}"; $message = $_POST ['message'] ; if (isset($_REQUEST['message'])) { } else{ mail( "myemail@aol.com", "Referral Form Results", $message, "From: example@aol.com" ); header( "Location: http://www.example.com" ); } ?> Form name is still set to "message". Quote Link to comment Share on other sites More sharing options...
trq Posted December 15, 2009 Share Posted December 15, 2009 The name of your form is not submitted along with the form, you should be checking the request method. eg; if ($_SERVER['REQUEST_METHOD'] == 'POST') { // send your email } Quote Link to comment Share on other sites More sharing options...
ramboangel11 Posted December 15, 2009 Author Share Posted December 15, 2009 <?php $message = "{$_POST['TEXT_1']}{$_POST['TEXT_20']}{$_POST['TEXT_21']}{$_POST['TEXT_4']}{$_POST['TEXT_2']}{$_POST['TEXT_5']}{$_POST['TEXT_6']}{$_POST['TEXT_7']}{$_POST['TEXT_8']}{$_POST['TEXT_9']}{$_POST['TEXT_10']}{$_POST['TEXT_11']}{$_POST['TEXT_12']}{$_POST['TEXT_13']}{$_POST['TEXT_14']}{$_POST['TEXT_15']}{$_POST['TEXT_16']}{$_POST['TEXT_2']}{$_POST['TEXT_3']}{$_POST['TEXT_4']}{$_POST['TEXT_5']}{$_POST['TEXT_6']}{$_POST['TEXT_7']}{$_POST['TEXT_8']}{$_POST['TEXT_9']}{$_POST['TEXT_AREA_3']}{$_POST['TEXT_14']}{$_POST['TEXT_15']}{$_POST['TEXT_16']}{$_POST['TEXT_17']}{$_POST['TEXT_18']}"; $message = $_POST ['message'] ; if ($_SERVER['REQUEST_METHOD'] == 'POST') { mail( "ramboangel11@aol.com", "Referral Form Results", $message, "From: administration@creativeinterventionsinc.com" ); header( "Location: http://www.creativeinterventionsinc.com" ); } ?> Still blank emails. Sorry this is such a trouble! Quote Link to comment Share on other sites More sharing options...
trq Posted December 15, 2009 Share Posted December 15, 2009 Put this at the vary top of your sendmail2.php script and show us the results. <?php echo '<pre>',print_r($_POST),'</pre>';die();?> 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.