searls03 Posted April 6, 2011 Author Share Posted April 6, 2011 ok addition working, but title1-8 still won't show if !empty Quote Link to comment https://forums.phpfreaks.com/topic/232693-mail-function/page/2/#findComment-1197937 Share on other sites More sharing options...
searls03 Posted April 6, 2011 Author Share Posted April 6, 2011 here the code.......also how do I put in the background image?: <body><div id='apDiv1'> <table width='408' border='1' cellspacing='2' cellpadding='2'> <tr> <th width='90' scope='col'>Event(s):</th> <th width='298' scope='col'>"; ?> <?php $sql = ("SELECT * FROM Events WHERE eventid='$eventid'"); $result = mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_array($result)){ $event = $row['event']; $startdate = $row['startdate']; $enddate = $row['enddate']; $description = $row['description']; $location = $row['location']; $subevent1 = $row['subevent1']; $subevent2 = $row['subevent2']; $subevent3 = $row['subevent3']; $subevent4 = $row['subevent4']; $subevent5 = $row['subevent5']; $subevent6 = $row['subevent6']; $subevent7 = $row['subevent7']; $subevent8 = $row['subevent8']; if (!empty($title1)) { $message .= '<br/>$title1:'; } if (!empty($title2)) { $message .= '<br/>$title2:' ; } if (!empty($title3)) { $message .= '<br/>$title3:'; } if (!empty($title4)) { $message .= '<br/>$title4:'; } if (!empty($title5)) { $message .= '<br/>$title5:'; } if (!empty($title6)) { $message .= '<br/>$title6:'; } if (!empty($title7)) { $message .= '<br/>$title7:'; } if (!empty($title8)) { $message .= '<br/>$title8:'; } } ?> Quote Link to comment https://forums.phpfreaks.com/topic/232693-mail-function/page/2/#findComment-1197939 Share on other sites More sharing options...
dreamwest Posted April 7, 2011 Share Posted April 7, 2011 Attachments http://www.wizecho.com/nav=php&s=email Quote Link to comment https://forums.phpfreaks.com/topic/232693-mail-function/page/2/#findComment-1197975 Share on other sites More sharing options...
searls03 Posted April 7, 2011 Author Share Posted April 7, 2011 How could I set this as a background image for the emails? Quote Link to comment https://forums.phpfreaks.com/topic/232693-mail-function/page/2/#findComment-1198013 Share on other sites More sharing options...
searls03 Posted April 7, 2011 Author Share Posted April 7, 2011 ok, I can get it to display the events........only it keeps repeating them..........how do I stop it: $sql = ("SELECT * FROM Events WHERE eventid='$eventid'"); $result = mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_array($result)){ $event = $row['event']; $startdate = $row['startdate']; $enddate = $row['enddate']; $description = $row['description']; $location = $row['location']; $subevent1 = $row['subevent1']; $subevent2 = $row['subevent2']; $subevent3 = $row['subevent3']; $subevent4 = $row['subevent4']; $subevent5 = $row['subevent5']; $subevent6 = $row['subevent6']; $subevent7 = $row['subevent7']; $subevent8 = $row['subevent8']; if (!empty($title1)) { $message .= "<br/>$title1"; } if (!empty($title2)) { $message .= "<br/>$title2" ; } if (!empty($title3)) { $message .= "<br/>$title3"; } if (!empty($title4)) { $message .= "<br/>$title4"; } if (!empty($title5)) { $message .= "<br/>$title5"; } if (!empty($title6)) { $message .= "<br/>$title6"; } if (!empty($title7)) { $message .= "<br/>$title7"; } if (!empty($title8)) { $message .= "<br/>$title8"; } } Quote Link to comment https://forums.phpfreaks.com/topic/232693-mail-function/page/2/#findComment-1198022 Share on other sites More sharing options...
dreamwest Posted April 7, 2011 Share Posted April 7, 2011 SELECT * FROM Events WHERE eventid='$eventid' LIMIT 1 Quote Link to comment https://forums.phpfreaks.com/topic/232693-mail-function/page/2/#findComment-1198029 Share on other sites More sharing options...
searls03 Posted April 7, 2011 Author Share Posted April 7, 2011 i got it working......I had the loop ending wrongly Quote Link to comment https://forums.phpfreaks.com/topic/232693-mail-function/page/2/#findComment-1198032 Share on other sites More sharing options...
searls03 Posted April 7, 2011 Author Share Posted April 7, 2011 so any help on the background issue?: with this code it works on my ipod but not gmail? is this a browser specific or something $mailimg = ' <img src="http://final.net46.net/button/boyscout.jpg"</a> '; $message = "<html> <style type='text/css'> #apDiv1 { position:absolute; left:338px; top:278px; width:311px; height:129px; z-index:1; } #apDiv2 { position:absolute; left:50px; top:207px; width:181px; height:149px; z-index:2; } #apDiv2 { text-align: center; } body { background-image: url(final.net46.net/button/boyscout.jpg); background-repeat: no-repeat; } </style> </head> <body><div id='apDiv1'> <table width='408' border='1' cellspacing='2' cellpadding='2'> <tr> <th width='90' scope='col'>Event(s):</th> <th width='298' scope='col'>"; $sql = ("SELECT * FROM Events WHERE eventid='$eventid'"); $result = mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_array($result)){ $event = $row['event']; $startdate = $row['startdate']; $enddate = $row['enddate']; $description = $row['description']; $location = $row['location']; $subevent1 = $row['subevent1']; $subevent2 = $row['subevent2']; $subevent3 = $row['subevent3']; $subevent4 = $row['subevent4']; $subevent5 = $row['subevent5']; $subevent6 = $row['subevent6']; $subevent7 = $row['subevent7']; $subevent8 = $row['subevent8']; } if (!empty($title1)) { $message .= "<br/>$title1"; } if (!empty($title2)) { $message .= "<hr><br/>$title2" ; } if (!empty($title3)) { $message .= "<hr><br/>$title3"; } if (!empty($title4)) { $message .= "<hr><br/>$title4"; } if (!empty($title5)) { $message .= "<hr><br/>$title5"; } if (!empty($title6)) { $message .= "<hr> <br/>$title6"; } if (!empty($title7)) { $message .= "<hr><br/>$title7"; } if (!empty($title8)) { $message .= "<hr><br/>$title8"; } ?> <?php $message .=" </th> </tr> <tr> <th>Price:</th> <th> $ $total </th> </tr>"; ?> <?php $message .=" <tr> <th>Registrant:</th> <th> $name </th> </tr> </table>"; ?> <?php $message .=" </div> <div id='apDiv2'>$name <p> </p> <p> </p> <p><a href='final.net46.net' target='_new'><strong>Troop 78 Home</strong></a></p> <p> </p> <p> </p> <p><strong><a href='http://www.cornhuskercouncil.org'>Cornhusker Council</a></strong></p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> </div> </body> </html>"; // end of message $headers = "From: $from\r\n"; $headers .= "Content-Type: text/html\r\n"; $to = "$to"; $message .= $mailimg . $message; // Finally send the activation email to the member mail($to, $subject, $message, $headers); Quote Link to comment https://forums.phpfreaks.com/topic/232693-mail-function/page/2/#findComment-1198409 Share on other sites More sharing options...
searls03 Posted April 7, 2011 Author Share Posted April 7, 2011 oh and it is displaying the table twice. Quote Link to comment https://forums.phpfreaks.com/topic/232693-mail-function/page/2/#findComment-1198412 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.