Jump to content

Recommended Posts

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~

Link to comment
https://forums.phpfreaks.com/topic/285377-redirect-after-image-load-php/
Share on other sites

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?

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"> 
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.