| | |
php mailto () fuction
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
You can use php's mail function..
Ignorance is definitely not bliss!
*PM asking for help will be ignored*
*PM asking for help will be ignored*
the page was set up so it uses the
the code that was originally created looks like this
i was playing about with this before to see if i could get it to load the page without it being coded again to get round the mysql problem. with the code like this it will not display the images and the code dies when it gets to the mysql.
this is another page which was already meant to be set up according to the lad who was working on it before me.
mail() function but it does not like the mysql in the code when the page is being created it just keeps throwing up errors.the code that was originally created looks like this
PHP Syntax (Toggle Plain Text)
<?php // construct mailing list array $merc_list = explode(",",$merc_mailingList); // deploy the emails for($i=0; $i<count($merc_list); $i++){ $message = "<style type=\"text/css\">body { margin: 0; background: ; background-image: url(); background-repeat: no-repeat; } .mainTxt {font-size: 11px; color:#444444; font-family: Arial, Helvetica, sans;} .whiteTxt {font-size: 9px; color:#FFFFFF; font-family: Arial, Helvetica, sans;} a:link {color:#EB7324} ul {font-size: 9px; color:#EB7324;padding-left: 5px;} .style3 {font-family: Geneva, Arial, Helvetica, sans-serif; color: #FFFFFF; font-weight: bold; } .style1 {font-family: Arial, Helvetica, sans-serif; font-size: 10px;color: #666666;} </style>"; $message .= "<body leftmargin=\"0\" topmargin=\"0\"> <table width=\"900\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"5\"> <tr> <td height=\"95\" colspan=\"2\" scope=\"col\"><img src=http://acmeart.co.uk/mercury/layout/BroadsheetSample/broadhead.jpg width=\"900\" height=\"150\" /></td> </tr> <tr> <td height=\"25\" colspan=\"2\" scope=\"col\"><span class=\"mainTxt\"><strong>$broad_topictitle1</strong></span></td> </tr> <tr> <th width=\"23%\" height=\"200\" scope=\"col\"><div align=\"left\"> <?php $query = "SELECT broad1 FROM images_broad"; $result=mysql_query($query); while($row=mysql_fetch_array($result, MYSQL_ASSOC)){ echo '<img src="'.$row['broad1'].'"/>'; } ?> <p> </p></div></th> <td width=\"77%\" scope=\"col\"><table width=\"99%\" border=\"0\" cellpadding=\"10\" cellspacing=\"0\"> <tr> <td align=\"left\" valign=\"top\"><span class=\"mainTxt\">$broad_messagebody1</span></td> <!-- End Image 1 --> </tr> </table> <p> </p> <p> </p> <p> </p> <p> </p></td> </tr> <tr> <td height=\"28\" colspan=\"2\" scope=\"col\"><span class=\"mainTxt\"><strong>$broad_topictitle2</strong></span></td> </tr> <tr> <th height=\"95\" scope=\"col\"><div align=\"left\"><img src=\"http://acmeart.co.uk/mercury/layout/BroadsheetSample/broad2.jpg\" width=\"200\" height=\"200\" /><p> </p></div></th> <td scope=\"col\"><table width=\"99%\" border=\"0\" cellpadding=\"10\" cellspacing=\"0\"> <tr> <td align=\"left\" valign=\"top\"><span class=\"mainTxt\">$broad_messagebody2</span></td> <!-- End Image 1 --> </tr> </table> <p> </p> <p> </p> <p> </p> <p> </p></td> </tr> <tr> <td colspan=\"2\" scope=\"col\"><img src=\"http://acmeart.co.uk/mercury/layout/BroadsheetSample/broadfoot.jpg\" width=\"900\" height=\"150\" /></td> </tr> <tr> <td height=\"13\" colspan=\"2\" scope=\"col\"><div align=\"justify\"><span class=\"style1\">Linacre Voice is a monthly bulletin from LinacreOne Community Partnership 140-142 Linacre Road Litherland L21 8JU Tel: (0151) 922 4898 Open Monday - Thursday 10:00am - 4:00pm <font size=\"1\"></font></span> </div></td> </tr> </table> </table> </body>"; // Contacts $replyName = "$merc_replyId"; $replyEmail = "$merc_replyAddress"; $contactname = ""; $contactemail = "$merc_list[$i]"; // Subject $subject = "$merc_messageTitle"; // Headers $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "From: ".$replyName." <".$replyEmail.">\r\n"; $headers .= "To: ".$contactname." <".$contactemail.">\r\n"; mail($contactemail, $subject, $message, $headers); } // END for ?>
i was playing about with this before to see if i could get it to load the page without it being coded again to get round the mysql problem. with the code like this it will not display the images and the code dies when it gets to the mysql.
this is another page which was already meant to be set up according to the lad who was working on it before me.
You can't have in $message. Since it is already a php variable. Assign only the <img src value to $message. Then try again. That will surely fix one of your problems.
•
•
•
•
<?php
$query = "SELECT broad1 FROM images_broad";
$result=mysql_query($query);
while($row=mysql_fetch_array($result, MYSQL_ASSOC)){
echo '<img src="'.$row['broad1'].'"/>';
}
?>
Ignorance is definitely not bliss!
*PM asking for help will be ignored*
*PM asking for help will be ignored*
the $message variable is set to be the information that is sent out so before this is set could i set more variables to be the images and then set the image source to be these variables would that get round the problem of having the mysql inside the code for the message variable.
would the code for this be something like
and then use the $image1
would the code for this be something like
PHP Syntax (Toggle Plain Text)
$image1 = <?php $query = "SELECT broad1 FROM images_broad"; $result=mysql_query($query); while($row=mysql_fetch_array($result, MYSQL_ASSOC)){ echo '<img src="'.$row['broad1'].'"/>'; } ?>
and then use the $image1
the code i have got for the database connection looks like this and it is placed before the body tag in the php page so that it has no effect on what it being displayed on the page
when the variable l $message has been set to equal the image from the database would it be displayed in the image tag in the body of the message like this
PHP Syntax (Toggle Plain Text)
$query = "SELECT broad1 FROM images_broad"; $result=mysql_query($query); while($row=mysql_fetch_array($result, MYSQL_ASSOC)){ $message.= '<img src="'.$row['broad1'].'"/>';
when the variable l $message has been set to equal the image from the database would it be displayed in the image tag in the body of the message like this
PHP Syntax (Toggle Plain Text)
<img src=\"$message\" />
I didn't get you.. What I said was,
concat <img src='row1['broad1']> to $message. So, it will be like,
$message.=$row1['broad1'];
then again,
concat <img src='row1['broad1']> to $message. So, it will be like,
$message.=$row1['broad1'];
then again,
php Syntax (Toggle Plain Text)
$message.=<p> </p></div></th> <td width=\"77%\" scope=\"col\"><table width=\"99%\" border=\"0\" cellpadding=\"10\" cellspacing=\"0\"> <tr> //.... and so on
Ignorance is definitely not bliss!
*PM asking for help will be ignored*
*PM asking for help will be ignored*
instead of putting the code in for the message is there not a way to just recall the page which already has the images inserted into it from the database. the page is created when the user goes to the preview page.
i was trying to work this out using an i frame but when it went to the page where it tells the user the message was sent it was displaying the preview page over the top of that page and the email was blank.
if that could be done it would save duplicating the code to produce the same page twice and if it can be done it would save the hassle of trying to insert images into the code for the message as it clearly does not want mysql code in that section of the code.
i was trying to work this out using an i frame but when it went to the page where it tells the user the message was sent it was displaying the preview page over the top of that page and the email was blank.
if that could be done it would save duplicating the code to produce the same page twice and if it can be done it would save the hassle of trying to insert images into the code for the message as it clearly does not want mysql code in that section of the code.
![]() |
Other Threads in the PHP Forum
- Previous Thread: combing html form and form handler in same page
- Next Thread: Can't get exec() or system() to work.
| Thread Tools | Search this Thread |
apache api array autocomplete beginner binary body broken cakephp class cms code cron curl database dataentry date date/time duplicates dynamic ebooks email emptydisplayvalue error execute explodefunction file firstoptioninphpdroplist folder form forms function functions google href htaccess html image include ip javasciptvalidation javascript joomla keywords limit link list login matching mediawiki memmory menu msqli_multi_query multiple mycodeisbad mysql navigation number oop parameter paypal pdf php phpincludeissue query random recourse recursive regex script search seo server sessions shot source sp space speed sql static subdomain subscription system table tag tutorial tutorials update upload url validator variable vbulletin video web webdesign white xml youtube






