/ Published in: PHP
simple image rotation script; save as rotate.php in folder with images, call to display
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//save in folder with images, refer in scriptAdd the script like you would add an image. //<img src=â€path-to-your-images/rotate.phpâ€> //images/home-page/rotate.php $folder = '.'; $extList['gif'] = 'image/gif'; $extList['jpg'] = 'image/jpeg'; $extList['jpeg'] = 'image/jpeg'; $extList['png'] = 'image/png'; $img = null; $folder = $folder.'/'; } if ( ) { $img = $folder.$imageInfo['basename']; } } else { if ( ) { $fileList[] = $file; } } $img = $folder.$fileList[$imageNumber]; } } if ($img!=null) { $contentType = 'Content-type: '.$extList[ $imageInfo['extension'] ]; } else { } }