Link to home
Start Free TrialLog in
Avatar of mindwarpltd
mindwarpltd

asked on

How can I show another page AFTER my php processing has finished?

I'm calling a php script which does some processing.

I want to briefly show some on that page which says "finished".

Then show another page.

I know I could have used this..
Header('Location: http://www.whaterver.com');

But this would allow me to show finished.

What can I do ?
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

If you want it to appear only briefly, use a 'meta' refresh tag that redirects to the new page after a few seconds.  The '5' in the sample is for 5 seconds.
<meta http-equiv="refresh" content="5;url=http://example.com/" />

Open in new window

Avatar of mindwarpltd
mindwarpltd

ASKER

But that won't wait for my page to finished will it ?
add this line
header('Location:http://www.example.com');
if you get this error

Warning: Cannot modify header information - headers already sent by

then it means you have printed something before the header,
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
DaveBaldwin's answer is correct and will work, but the UX characteristics of this concept are questionable.

1. If what you put on the screen before the redirect does not matter, don't put it on the screen.
2. If what you put on the screen DOES matter, leave it there, so the client can read it.  Give the client a link to move to the next page.  That's the right way to program the client-server relationship.

Best, ~Ray