We help IT Professionals succeed at work.

PHP Animated gif

fermium
fermium asked
on
I have a small php script which loads gif images dynamically.

The code is:

<?php
$image_path = "images/p1.gif";
$image = imagecreatefromgif($image_path);
header('Content-Type: image/gif');
imagegif($image);
imagedestroy($image);
?>

However problem is, it does not load animated gifs. It simply loads the first frame of animated gif. How to display animated gif completely?

Plz help.
Comment
Watch Question

Commented:
Ok got the answer, thanks anyway:

// display the image
$image = "images/p1.gif";
readfile($image);