Lineman Posted June 20, 2008 Share Posted June 20, 2008 Have been looking at PHP Includes and was wondering if i could use the include () function to include an image file on a webpage? Thanks for any and all help/advice. Link to comment https://forums.phpfreaks.com/topic/111076-php-includes/ Share on other sites More sharing options...
Orio Posted June 20, 2008 Share Posted June 20, 2008 You can, but that will just print out the image contents, as if you opened it with notepad or such (it won't display it). What exactly are you trying to achieve? Orio. Link to comment https://forums.phpfreaks.com/topic/111076-php-includes/#findComment-569997 Share on other sites More sharing options...
Lineman Posted June 20, 2008 Author Share Posted June 20, 2008 Hello Orio, I have been experimenting with the include () function and have successfully included text files on a web page and i was just wondering if i could include an image using the same method? Link to comment https://forums.phpfreaks.com/topic/111076-php-includes/#findComment-570002 Share on other sites More sharing options...
Orio Posted June 20, 2008 Share Posted June 20, 2008 You want to display the image, right? For that you simply need to use the <img> tag, with out includes: echo "<img src=\"{$filename}\">"; Orio. Link to comment https://forums.phpfreaks.com/topic/111076-php-includes/#findComment-570013 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.