NextGenForum.net Posted December 13, 2007 Share Posted December 13, 2007 Hi, I wanted to know how to php include a .gif image, when i do it like this <?php include (images/index_01.gif); ?> i get this error; Parse error: syntax error, unexpected '/' in /home/price7/public_html/index.php on line 46 Link to comment https://forums.phpfreaks.com/topic/81567-php-include-a-gif-image/ Share on other sites More sharing options...
helraizer Posted December 13, 2007 Share Posted December 13, 2007 add single (or double) quotes to the location so <?php include ('images/index_01.gif'); ?> See if that works. Sam Link to comment https://forums.phpfreaks.com/topic/81567-php-include-a-gif-image/#findComment-414214 Share on other sites More sharing options...
PFMaBiSmAd Posted December 13, 2007 Share Posted December 13, 2007 Your parse error is because you need some quotes around the path/file to make it a string that the include() function expects. However, you cannot include an image on a web page. You can only put images on a web page using an <img src="url_of_the_image" alt=""> tag. Read this - http://w3schools.com/html/html_images.asp Link to comment https://forums.phpfreaks.com/topic/81567-php-include-a-gif-image/#findComment-414216 Share on other sites More sharing options...
NextGenForum.net Posted December 13, 2007 Author Share Posted December 13, 2007 I was told on another forum that i could use a cache (php include) to stop my sliced images from photoshop from loading aafter every click ??? Thanks Link to comment https://forums.phpfreaks.com/topic/81567-php-include-a-gif-image/#findComment-414217 Share on other sites More sharing options...
NextGenForum.net Posted December 14, 2007 Author Share Posted December 14, 2007 <img src="url_of_the_image" alt=""> Will this cache??? Thanks Link to comment https://forums.phpfreaks.com/topic/81567-php-include-a-gif-image/#findComment-415016 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.