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 ?
PHP

Avatar of undefined
Last Comment
Ray Paseur

8/22/2022 - Mon
Dave Baldwin

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

mindwarpltd

ASKER
But that won't wait for my page to finished will it ?
khaledf

add this line
header('Location:http://www.example.com');
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
khaledf

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
Dave Baldwin

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Ray Paseur

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