|
Posted by Manuel Lemos on 08/18/05 03:34
Hello,
on 08/17/2005 07:42 PM Jake Sapirstein said the following:
> I am a PHP newbie, pardon the elementary question - I am starting out with using print() to send HTML to the browser to be rendered. All is well with text and tables and other HTML formatting, but when trying to send IMG tags, my images aren't getting displayed.
>
> Is there a good tutorial out there (I can't seem to find it) on how to send HTML to a browser where the HTML includes IMG tags with links to image files? If I need to set up the filepaths with variables I can figure that out, but not sure what functions to use to set the paths up.
You need to use absolute URLs for the images.
Still, some mail programs and webmail sites disable remote image
displaying by default as images may be beacons to spy on users.
ALternatively you can embeded images in the actual HTML messages and
they always display properly. That is done with MIME multipart/related
messages. You may want to take a look at this MIME message class that
can be used to compose messages with embedded images. It comes with an
example named test_html_mail_message.php that shows exactly how to do that:
http://www.phpclasses.org/mimemessage
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
[Back to original message]
|