john_bboy7 Posted June 3, 2009 Share Posted June 3, 2009 How can i use dynamic image in phpbb forum? I have seen many users with counter but thats not the problem..i know how to make it..but my dynamic image is in .php ..... and [.img] sumthing.php [/img] does not work.. And besides that: See this image (Some one else is using it). Its a dynamic image but in .gif format... how is that possible? Below is my source code: <?php Header ("Content-type: image/png"); $img_handle = imageCreateFrompng("www.asdasdas.com/image.png"); Imagepng ($img_handle); ImageDestroy ($img_handle); ?> It shows me the image but the link is in .php format. and .php is not supported in phpbb img tag. Quote Link to comment https://forums.phpfreaks.com/topic/160813-solved-how-can-i-use-dynamic-image-in-phpbb-forum/ Share on other sites More sharing options...
Alex Posted June 3, 2009 Share Posted June 3, 2009 You can use a .htaccess file to make it so that a .png would be read as a .php. eg. <Files "index.png"> AddType application/x-httpd-php .png </Files> You could then have a file named 'index.png' with your source it in, and you could view it as index.png but the server would still process it like .php Quote Link to comment https://forums.phpfreaks.com/topic/160813-solved-how-can-i-use-dynamic-image-in-phpbb-forum/#findComment-848741 Share on other sites More sharing options...
john_bboy7 Posted June 3, 2009 Author Share Posted June 3, 2009 You can use a .htaccess file to make it so that a .png would be read as a .php. eg. <Files "index.png"> AddType application/x-httpd-php .png </Files> You could then have a file named 'index.png' with your source it in, and you could view it as index.png but the server would still process it like .php But i want the opposite,..that a .php would be read as a .png Because i am having 5 png images and 1 php files.. at every refresh the image changes here is my actual code: <?php Header ("Content-type: image/png"); $a=array( '1.png', '2.png', '3.png', '4.png', '5.png' ); $b=$a[array_rand($a)]; $img_handle = imageCreateFrompng("$b"); Imagepng ($img_handle); ImageDestroy ($img_handle); ?> Quote Link to comment https://forums.phpfreaks.com/topic/160813-solved-how-can-i-use-dynamic-image-in-phpbb-forum/#findComment-848744 Share on other sites More sharing options...
kickstart Posted June 3, 2009 Share Posted June 3, 2009 Hi Some versions checked for .gif, .jpg, etc at the end. As such you might get away with www.example.com/somescript.php?image.jpg . All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/160813-solved-how-can-i-use-dynamic-image-in-phpbb-forum/#findComment-848750 Share on other sites More sharing options...
john_bboy7 Posted June 3, 2009 Author Share Posted June 3, 2009 Hi Some versions checked for .gif, .jpg, etc at the end. As such you might get away with www.example.com/somescript.php?image.jpg . All the best Keith Not working Quote Link to comment https://forums.phpfreaks.com/topic/160813-solved-how-can-i-use-dynamic-image-in-phpbb-forum/#findComment-848759 Share on other sites More sharing options...
Alex Posted June 3, 2009 Share Posted June 3, 2009 You can use a .htaccess file to make it so that a .png would be read as a .php. eg. <Files "index.png"> AddType application/x-httpd-php .png </Files> You could then have a file named 'index.png' with your source it in, and you could view it as index.png but the server would still process it like .php But i want the opposite,..that a .php would be read as a .png Because i am having 5 png images and 1 php files.. at every refresh the image changes here is my actual code: <?php Header ("Content-type: image/png"); $a=array( '1.png', '2.png', '3.png', '4.png', '5.png' ); $b=$a[array_rand($a)]; $img_handle = imageCreateFrompng("$b"); Imagepng ($img_handle); ImageDestroy ($img_handle); ?> No. That is what you want.. You can save that code as a .png file.. And when visiting you'll be visiting like image.png .. Quote Link to comment https://forums.phpfreaks.com/topic/160813-solved-how-can-i-use-dynamic-image-in-phpbb-forum/#findComment-848834 Share on other sites More sharing options...
john_bboy7 Posted June 4, 2009 Author Share Posted June 4, 2009 Thanks AlexWD.. Quote Link to comment https://forums.phpfreaks.com/topic/160813-solved-how-can-i-use-dynamic-image-in-phpbb-forum/#findComment-848923 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.