timmah1 Posted July 27, 2009 Share Posted July 27, 2009 I have a form that when it is filled out, it mails the administrator. It sends the date correctly, but it does not send the $description Can somebody look and see what the problem might be? <?php if(isset($_POST['submit'])){ include("connect.php"); if (!empty($_POST['description'])) { foreach($_POST['description'] as $row=>$Act) { $description = mysql_real_escape_string($Act); $game = $_POST['posted_y'][$row]."-".$_POST['posted_m'][$row]."-".$_POST['posted_d'][$row]; $game_time = mysql_real_escape_string($_POST['game_time'][$row]); $away_team = mysql_real_escape_string($_POST['away'][$row]); $home_team = mysql_real_escape_string($_POST['home'][$row]); $premiere = mysql_real_escape_string($_POST['premiere'][$row]); $prediction = mysql_real_escape_string($_POST['prediction'][$row]); $posted_date = $_POST['posted_year']."-".$_POST['posted_month']."-".$_POST['posted_day']; $sport = mysql_real_escape_string($_POST['sport']); if (!empty($description)) { $sql = "INSERT INTO picks(sport, posted, game, game_time, description, away, home, prediction, premiere) VALUES( '$sport', '$posted_date', '$game', '$game_time', '$description', '$away_team', '$home_team', '$prediction', '$premiere');"; mysql_query($sql) or die("Sorry, there was a problem adding picks<br /> ".mysql_error()); } } echo "Picks for '".date("F j, Y", strtotime($posted_date))."' has been uploaded<br />"; echo "<a href='$back'>Go back to picks page</a><br />$count "; $to = "Vegas D Sports <[email protected]>"; //$to = "Vegas D Sports <[email protected]>"; $today = date("F j, Y", strtotime($posted_date)); $subject = "Pick Updates For ".$today.""; $message = " <html> <style type='text/css'> <!-- body,td,th { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; } .main { border: thin solid #000; } .header { color: #fff; font-weight: bold; } --> </style> <body> <table width='600' border='0' align='center' cellpadding='0' cellspacing='0' class='main'> <tr> <td align='center' valign='top' bgcolor='#333333' class='header'><h2>BASKETBALL FREE PICKS UPDATE</h2></td> </tr> <tr> <td valign='top' align='left'><table width='100%' border='0' cellspacing='0' cellpadding='6'> <tr> <td colspan='4' bgcolor='#d6d5d5'>The following 'picks' information has been uploaded.</td> </tr> <tr> <td bgcolor='#d6d5d5'><table width='100%' border='0' cellspacing='0' cellpadding='0'> <tr> <td><strong>Date: </strong>{$today}</td> </tr> <tr> <td>Picks are as follows: {$description}</td> <--THIS PART DON'T SHOW IN EMAIL </tr> </table></td> </tr> <tr> <td colspan='4' bgcolor='#d6d5d5'> </td> </tr> </table></td> </tr> </table> </body> </html> "; } $name = "BasketballFreePicks.com"; $from = "[email protected]"; $headers = "From: ". $name . " <" . $from . ">\r\n"; $headers .= "Content-Type: text/html; charset=\"iso-8859-1\""; $headers .= "Content-Transfer-Encoding: 7bit"; //$headers .= 'Cc: [email protected]' . "\r\n"; //$headers .= 'Bcc: [email protected]' . "\r\n"; // now lets send the email. mail($to, $subject, $message, $headers); } ?> Thanks in advance Link to comment https://forums.phpfreaks.com/topic/167622-solved-mail-not-sending-certain-things/ Share on other sites More sharing options...
methomps Posted July 27, 2009 Share Posted July 27, 2009 Are you sure there is anything in $description? Is something getting stored to the database? Link to comment https://forums.phpfreaks.com/topic/167622-solved-mail-not-sending-certain-things/#findComment-883957 Share on other sites More sharing options...
timmah1 Posted July 27, 2009 Author Share Posted July 27, 2009 Everything is being inserted into the database, so that's not the issue Link to comment https://forums.phpfreaks.com/topic/167622-solved-mail-not-sending-certain-things/#findComment-883961 Share on other sites More sharing options...
gevans Posted July 27, 2009 Share Posted July 27, 2009 Try getting rid of the curly brackets, {$description} to $description or droping out of the quotes ". $description ." If there's still no success put some text beside it to make usre it shows up in the same area; here". $description ." Link to comment https://forums.phpfreaks.com/topic/167622-solved-mail-not-sending-certain-things/#findComment-883969 Share on other sites More sharing options...
timmah1 Posted July 27, 2009 Author Share Posted July 27, 2009 I put this Picks are as follows: $description And the only thing that shows is "Picks are as follows:" Link to comment https://forums.phpfreaks.com/topic/167622-solved-mail-not-sending-certain-things/#findComment-883992 Share on other sites More sharing options...
gevans Posted July 27, 2009 Share Posted July 27, 2009 Check the variable before you build the email; <?php $subject = "Pick Updates For ".$today.""; var_dump($description); $message = " Link to comment https://forums.phpfreaks.com/topic/167622-solved-mail-not-sending-certain-things/#findComment-884003 Share on other sites More sharing options...
timmah1 Posted July 27, 2009 Author Share Posted July 27, 2009 It shows the variable with no problem. I think the issue might be $description = mysql_real_escape_string($Act); for the description, but the posted date is $posted_date = $_POST['posted_year']."-".$_POST['posted_month']."-".$_POST['posted_day']; The posted_date shows with no problem Link to comment https://forums.phpfreaks.com/topic/167622-solved-mail-not-sending-certain-things/#findComment-884009 Share on other sites More sharing options...
gevans Posted July 27, 2009 Share Posted July 27, 2009 I don't follow. If the data is assigned to the variable after this point then there is no issue with the variable itself. change; mail($to, $subject, $message, $headers); to mail($to, $subject, $description, $headers); to check if it sends ok... Link to comment https://forums.phpfreaks.com/topic/167622-solved-mail-not-sending-certain-things/#findComment-884033 Share on other sites More sharing options...
timmah1 Posted July 27, 2009 Author Share Posted July 27, 2009 Thanks gevans for all your help. I just rearranged the } and it seems to be working right now. Thanks again for all your help Link to comment https://forums.phpfreaks.com/topic/167622-solved-mail-not-sending-certain-things/#findComment-884151 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.