So, to all you PHP wizards out there, I have a question.
I've made a little script that will rotate avatars and disguise itself as a PNG (of course I have .htaccess with a rewrite rule for that as well) but for some reason it won't work on the forums. That is, it will correctly display the images if linked to as .php but not .png.
What's the problem?
Code:
<?php
header("Content-type: image/png");
$start = "1";
$end = "16";
$file_type = ".png";
$random = mt_rand($start, $end);
$image_name = $random . $file_type;
$newavatar = imagecreatefrompng($image_name);
imagepng($newavatar);
imagedestroy($newavatar);
?>
Code:
[img]http://limdul.byethost11.com/Chibi_Bloodlines/random.php[/img]
Code:
[img]http://limdul.byethost11.com/Chibi_Bloodlines/random.png[/img]
:-(
P.S. It works as a link in the browser itself:
http://limdul.byethost11.com/Chibi_Bloo ... random.png
P.P.S. Here's my .htaccess
Code:
RewriteEngine On
RewriteRule random.png random.php
P.P.P.S. A-ha! The script isn't redirected properly unless typed in manually in the browser. I guess I have to do something more with the rewrite engine?