Welcome Guest, Not a member yet? Register   Sign In
Redirect - refresh option doesn't, or is it me again!
#1

[eluser]PeteSig[/eluser]
Hi All

I'm doing some ci image manipulation, which is all going great, except for when I redircect to a page after the image manip; at which point I'm shown the orig image & not the new one.

To elaborate:
I have a page (p1) with a number of images - each of which has a button to click if the user wants to crop the image. This directs the user to another page (p2) which shows the image, uses jcrop to set the crop region & then does the crop. On completion of the crop function, it redirects to the first page (p1) with the image list.

However, after the redirect back to p1 I'm shown the orig images (pre-crop version displayed), if I hit F5 the cropped image version is displayed!

I'm using the 'refresh' option in the redirect, but its not refreshing!

Any ideas? Have I got the wrong end of the stick as to what the refresh option does?

Thanks in advance.

Pete
#2

[eluser]PeteSig[/eluser]
Ok forget the above.

It now seems to be behaving itself!?!?!

Cheers

Pete

------------------

Nope, orig mis-behaviour is back!

Could it be something to do with the crop image not having finished before the redirect page is loaded?

Pete
#3

[eluser]InsiteFX[/eluser]
May be because your browser is caching the web page!
IE F5

InsiteFX
#4

[eluser]PeteSig[/eluser]
Err, yes but isn't that what the refresh option of redirect() is supposed to do?
Refresh the page / flush the cache!?!?!?
If not, is there a way to go to a page & force a cache flush without user input / pressing F5?

As stated in my posts - it works sometimes & then not other times.
(I think I also mentioned that I used F5 to refresh the page / flush the cache!).

I've now put a sleep() inbetween doing the crop & the page refresh - which seems to be working.

Code:
if( ! $this->image_lib->crop())
{
    redirect($this->input->post('fail'));
}
usleep(500000); // sleep for 0.5 sec's
redirect($this->input->post('success'), 'refresh');

Cheers

Pete

PS. love the sig by the way. It'll be my ci mantra from now on.




Theme © iAndrew 2016 - Forum software by © MyBB