Jump to content

Help with <img src= tag


kd5h

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>
Link to comment
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] ?
Link to comment
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.
Link to comment
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..

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.