ok so i have this script
<?phpinclude("header.php");$img = $_GET['img']; $imageinfo=getimagesize($img); switch($imageinfo['mime']) { case "image/jpg": case "image/jpeg": case "image/pjpeg": $src_img=imagecreatefromjpeg("$img"); break; case "image/gif": $src_img = imagecreatefromgif("$img"); break; case "image/png": case "image/x-png": $src_img = imagecreatefrompng("$img"); break; } $src_img = imagerotate($src_img, 90, 0);imagejpeg ($src_img,$img);echo '<meta http-equiv="refresh" content="0; URL=viewer.php">';?>
using like this
<a href="rotate.php?img=uploads/'.$id.'/'.$file.'">Rotate</a>
all works well but when it redirects back to viewer.php the image hasn't changed UNTILL you refresh the page any ideas here is viewer.php
echo '<div style="width:710px;">';$handle = opendir(dirname(realpath(__FILE__)).'/uploads/'.$id.'/');echo '<ul class="gallery">'; while($file = readdir($handle)){ if($file !== '.' && $file !== '..' && $file !== 'index.html'){ echo ' <li> <div> <a href="uploads/'.$id.'/'.$file.'"> <img src="uploads/'.$id.'/'.$file.'" border="0" style="padding:10px;" height="100px" width="100px" /> </a> </div> <div> <a href="rotate.php?img=uploads/'.$id.'/'.$file.'">Rotate</a> </div> </li> '; } } echo '</ul></div>';