Picowico Posted January 15, 2014 Share Posted January 15, 2014 Hello Fellow Forumers, I am trying to work out how I can redirect after the following "image.php" has finished loading. I have a large loading image that I want to render and then redirect once complete. I have tried so many ways, but just can't work it out. My image code is: <?php Header ('Content-type: image/jpeg'); Header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); Header('Expires: Thu, 19 Nov 1981 08:52:00 GMT'); Header('Pragma: no-cache'); $image = imagecreatefromjpeg("image.jpg"); $img_width = 514; $img_height = 128; imagepng($image); imagedestroy($image); ?> Your help is greatly appreciated. Regards, Pico~ Quote Link to comment https://forums.phpfreaks.com/topic/285377-redirect-after-image-load-php/ Share on other sites More sharing options...
requinix Posted January 15, 2014 Share Posted January 15, 2014 You cannot show an image and redirect at the same time. For one, it doesn't make sense: if you're redirecting then the user won't get a chance to see the image, and if you want them to see the image then why are you redirecting them away from it? Quote Link to comment https://forums.phpfreaks.com/topic/285377-redirect-after-image-load-php/#findComment-1465305 Share on other sites More sharing options...
QuickOldCar Posted January 15, 2014 Share Posted January 15, 2014 Why even use gd for this? Just size the original image or if you wanted it smaller, resize your image first. If you want to show something like a preview image then the site, you can time header or meta redirects. header( "Refresh:10; url=http://site.com/welcome", true, 303); or <meta http-equiv="refresh" content="10;url=http://site.com/welcome"> Quote Link to comment https://forums.phpfreaks.com/topic/285377-redirect-after-image-load-php/#findComment-1465307 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.