Jump to content

echo an image from a directory on my hosting server


Reaper0167

Recommended Posts

header('Content-Type: image/png');

 

I added this line to the top of the php page with the echo statment you showed me. But there is just a little red x.

 

$newname="userimages/".$image_name;

echo '<img src="$newname">';

 

There is more code,, just showing what I am trying to echo.

And is it possible to include png, jpg, and gif all in one header content?

header('Content-Type: image/png');

 

I added this line to the top of the php page with the echo statment you showed me. But there is just a little red x.

 

$newname="userimages/".$image_name;

echo '<img src="$newname">';

 

There is more code,, just showing what I am trying to echo.

And is it possible to include png, jpg, and gif all in one header content?

 

Just echo out a complete path to see if it works.

 

You also might need a / in front of the userimages.

Archived

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

×
×
  • 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.