Jump to content

Archived

This topic is now archived and is closed to further replies.

kd5h

Help with <img src= tag

Recommended Posts

Can someone tell me why this <img src will not work.
The email appears go but it doesn't really. If I change the <img src tag ( delete it )
the email goes. I'm at a loss !!!

<?php
$subject = 'Post Card from Cruz N';
$name = $_POST["name"];
$email = $_POST["email"];
$picture = $_POST["picture"];
$headers = 'MIME-Version: 1.0' . "\n" . 'Content-type: text/html; charset=iso-8859-1' . "\n";
$headers .= 'From: user <user@website.com>' . "\n";

$message = '<html><head><title>Picture</title></head>';
$message .= '<body><p>Here is the picture</p>';
$message .= '<img src="';
$message .= $picture;
$message .= '" alt="picture">';
$message .= '</body></html>';
;
// Mail it
$ok = mail("$name <$email>", $subject, $message, $headers);
if ( $ok ) echo "OK";
?>
<html>
<head><title>Message Send</title></head>
<body>
<h3>Your message has been sent</h3>
Message sent to <?php echo ( $name ); ?> <br>
at Email address <?php echo ( $email ); ?> <br>
Picture <?php echo ( $picture ); ?> <br><br>
<img src = <?php echo ( $picture ); ?> ><br><br>
</body>
</html>

Share this post


Link to post
Share on other sites
There's an orphan ; after the message string concatenation ends. Remove it.

For an image to display in an email you need the full domain path included. Is $picture something like [a href=\"http://www.mysite.com/happyface.jpg\" target=\"_blank\"]http://www.mysite.com/happyface.jpg[/a] ?

Share this post


Link to post
Share on other sites
[!--quoteo(post=387007:date=Jun 22 2006, 05:35 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ Jun 22 2006, 05:35 PM) [snapback]387007[/snapback][/div][div class=\'quotemain\'][!--quotec--]
There's an orphan ; after the message string concatenation ends. Remove it.

For an image to display in an email you need the full domain path included. Is $picture something like [a href=\"http://www.mysite.com/happyface.jpg\" target=\"_blank\"]http://www.mysite.com/happyface.jpg[/a] ?
[/quote]

Yes, $picture is the full domain path.
I have tried every combonation to get to work.

Funny think is, if I place

$message

at the end of the HMTL it will display the message just like I want it on the webpage.
go figure.

Share this post


Link to post
Share on other sites
$headers = 'MIME-Version: 1.0' . "\n" . 'Content-type: text/html; charset=iso-8859-1' . "\n";
$headers .= 'From: CruzN <cruzn@virtualhale.com>' . "\n";
$message = '<html><head><title>PostCard from Cruz N</title></head>';
$message .= '<body><p>Here is a postcard from Cruz N</p>';
[b]$message .= '<img src = "http://www.virtualhale.com/arky.jpg" alt = "picture">'; [/b]
$message .= '</body></html>'
;


If I comment this line out the message goes.
I don't understand what keeps it from going with this tag..

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.