Jump to content


Photo

Help with <img src= tag


  • Please log in to reply
3 replies to this topic

#1 kd5h

kd5h
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 22 June 2006 - 09:46 PM

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>

#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 22 June 2006 - 10:35 PM

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] ?
Legend has it that reading the manual never killed anyone.
My site

#3 kd5h

kd5h
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 23 June 2006 - 02:57 AM

[!--quoteo(post=387007:date=Jun 22 2006, 05:35 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ Jun 22 2006, 05:35 PM) View Post[/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.

#4 kd5h

kd5h
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 23 June 2006 - 03:11 AM

$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>';
$message .= '<img src = "http://www.virtualha...e.com/arky.jpg" alt = "picture">';
$message .= '</body></html>'
;


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






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users