CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   PHP (http://www.codingforums.com/forumdisplay.php?f=6)
-   -   how to show image in brower with php (http://www.codingforums.com/showthread.php?t=269582)

minkoko 08-05-2012 05:07 AM

how to show image in brower with php
 
Hi Everybody ,
i want to make a show image when i run php file

so, how to write php file with image show in brower

i mean run this localhost/image.php

the image is show in browser

Thanks,

Len Whistler 08-05-2012 06:43 AM

Untested
PHP Code:

<?php

echo "<img src=\"images/photo.jpg\">";

?>


MarkR 08-06-2012 10:53 AM

PHP Code:


header
('Content-type: image/jpg');
readfile($fullpathtoimg); 

Make sure you adjust the header content type depending on the image type.

minkoko 08-09-2012 03:23 AM

Quote:

Originally Posted by MarkR (Post 1258124)
PHP Code:


header
('Content-type: image/jpg');
readfile($fullpathtoimg); 

Make sure you adjust the header content type depending on the image type.

Right! i got it ,thanks for advice:thumbsup:

Code:

$fullpathtoimg = "eg.jpg";
header('Content-type: image/jpg');
readfile($fullpathtoimg);

thanks Len Whistler
i got two :thumbsup: method

Birlamedisoft 08-09-2012 05:18 AM

[QUOTE=minkoko;1259163]Right! i got it ,thanks for advice:thumbsup:

Code:

$fullpathtoimg = "eg.jpg";
header('Content-type: image/jpg');
readfile($fullpathtoimg);



Thanks for the information. i was also searching for the same from many days.


All times are GMT +1. The time now is 10:57 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.