note 101640 added to function.imagecreatefromgif
| From: | tammam dot nima at gmail dot com | Date: | Fri, 31 Dec 2010 12:23:55 +0000 |
| Subject: | note 101640 added to function.imagecreatefromgif | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-175368@lists.php.net to get a copy of this message | ||
Animated GIFs can be loaded with imagecreatefromgif(), but can NOT be "created" by PHP
with imagegif().
If you are looking to have PHP open an animated GIF file, you can use file_get_contents.
This displays a different animated GIF for different countries.
<?php
//adImage.php
$countryByIP = file_get_contents('http://stonito.com/script/geoip/?ip=' .
$_SERVER['REMOTE_ADDR']);
if($countryByIP == "GB"){
$im = file_get_contents('UK.gif');
}else if($countryByIP == "US"){
$im = file_get_contents('US.gif');
}else if($countryByIP == "CA"){
$im = file_get_contents('Canada.gif');
}else if($countryByIP == "AU"){
$im = file_get_contents('Australia.gif');
}else{
$im = file_get_contents('OtherCountries.gif');
}
header('Content-Type: image/gif');
echo $im;
?>
In your page;
<img src="pathTo/adImage.php"/>
----
Server IP: 69.147.83.197
Probable Submitter: 24.81.20.32
----
Manual Page -- http://www.php.net/manual/en/function.imagecreatefromgif.php
Edit -- https://master.php.net/note/edit/101640
Del: integrated -- https://master.php.net/note/delete/101640/integrated
Del: useless -- https://master.php.net/note/delete/101640/useless
Del: bad code -- https://master.php.net/note/delete/101640/bad+code
Del: spam -- https://master.php.net/note/delete/101640/spam
Del: non-english -- https://master.php.net/note/delete/101640/non-english
Del: in docs -- https://master.php.net/note/delete/101640/in+docs
Del: other reasons-- https://master.php.net/note/delete/101640
Reject -- https://master.php.net/note/reject/101640
Search -- https://master.php.net/manage/user-notes.php