sblake161189 Posted February 2, 2011 Share Posted February 2, 2011 Hi Guys, I have a php mail script that calculates a branch to send it to dependant on the postcode which works fine as it goes to the right email and when I echo the script to show branch name it comes up with the correct branch name. However when you open the email I cannot get it to display the 'branch name'. It will display all the other bits of information that has been 'posted' from the form. But wont display the branch name form an sql database table. The code below proves that it finds the branch name. while($row = mysql_fetch_array( $result )) { $ter = $row['Ter']; $branchemail = $row['BranchEmail']; $branchname = $row['BranchName']; } This is the PHP Mail in HTML part below <td bgcolor=#FFFFFF bordercolor=#666666 valign=top>' . ( $row['BranchName']) . '</td> But when the email comes through the branch name is always blank. However on this page I can get it to echo the branch name and it displays the branch name and also emails to the branch email address. Any ideas why it doesn't work. Cheers, S Link to comment https://forums.phpfreaks.com/topic/226468-wont-display-branch-name/ Share on other sites More sharing options...
sblake161189 Posted February 2, 2011 Author Share Posted February 2, 2011 Sorry forgot to say the other fields work, ie what it has got from the form <td bgcolor=#FFFFFF bordercolor=#666666 valign=top>' . strip_tags($_POST['comments']) . '</td> They show in the email... Link to comment https://forums.phpfreaks.com/topic/226468-wont-display-branch-name/#findComment-1168947 Share on other sites More sharing options...
BlueSkyIS Posted February 2, 2011 Share Posted February 2, 2011 see how the line of html you posted is oddly colored? that often indicates broken or missing elements. values in HTML tags should always be quoted or double-quoted. echo '<td bgcolor="#FFFFFF" bordercolor="#666666" valign="top">' . strip_tags($_POST['comments']) . '</td>'; Link to comment https://forums.phpfreaks.com/topic/226468-wont-display-branch-name/#findComment-1168976 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.