0

HI. The following code from the beginning of an html email works in a dynamically generated email to insert a fixed image. When I replace the end of the image URL string to try and make it dynamic, I cannot get it to work. My replacement string is at the end of the working code. Can anyone tell me what I am missing (probably a lot:) Many thanks.

<?php
$id = $row_rsucites['Item_Num'];
$to = $row_rsucites['Email1'] . " , ";
$to .= $row_rsucites['Email2'] . " , ";
$to .= $row_rsucites['Email3'];
$subject = "Sample Subject";
$headerPic = '<IMG src="http://sample.com/Sections/uctionItems/photos/photo.jpg">';
$body = "<html><body>" .
    "<h2><center>With Compliments: From Sample.com!<br><br>
	Sample Text!</center></h2>" .

	"<p><center>$headerPic</center></p>" .

My attempt at dynamic image by replacing the $headerPic line photo.jpg at the end with dynamic bla bla is:

$headerPic = '<IMG src="http://sample.com/Sections/uctionItems/photos/$row_rsucites['Image_URL'];">';

where the dbase field Image_URL holds .jpg photo names which are stored in the folder photos

Any help would be greatly appreciated!

flag

1 Answer

0

Looks like quotes issue. Try this:

$headerPic = '<IMG src="http://sample.com/Sections/uctionItems/photos/' . $row_rsucites['Image_URL'] . '">';
link|flag
HI. Thanks very much for you help. I got it working now, and I appreciate your taking the time to look at it. Greg – kidcobra Dec 17 at 12:42

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.