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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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