Jump to content

[SOLVED] How can i use dynamic image in phpbb forum?


john_bboy7

Recommended Posts

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).

 

geosig.gif

 

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.

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

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); 
?>

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

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.