English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I need to have it so that this php echos an image, how can I do that? The image is called home.jpg


printTiles(); ?>


Thanks

2007-07-14 08:46:46 · 4 answers · asked by jeff lemon 1 in Computers & Internet Programming & Design

4 answers

function printTitles{
return '';
}

2007-07-14 09:20:46 · answer #1 · answered by Aria 2 · 0 0

You can't echo an image directly into a page. Echo an img html tag that points to the image.

If it is a dynamically generated image, then place the image generation code in a separate PHP file and echo an img tag with the src attribute set to load the second PHP file as an image. Make sure to use the header() function to properly set the MIME type, otherwise it won't work.

2007-07-14 15:53:39 · answer #2 · answered by Alex F 2 · 0 0

PHP can't "echo" an image directly onto the page*. Instead you need to generate and then echo the appropriate tag.

*Actually, the "GD2" extension library can do something like this.

2007-07-14 16:32:39 · answer #3 · answered by Anonymous · 0 0

echo ("");

2007-07-14 18:25:09 · answer #4 · answered by just "JR" 7 · 0 0

fedest.com, questions and answers