Solved

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

Posted on 2010-09-12
6
325 Views
Last Modified: 2012-08-14
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 ?
0
Comment
Question by:mindwarpltd
6 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
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

0
 

Author Comment

by:mindwarpltd
Comment Utility
But that won't wait for my page to finished will it ?
0
 
LVL 9

Expert Comment

by:khaledf
Comment Utility
add this line
header('Location:http://www.example.com');
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 9

Expert Comment

by:khaledf
Comment Utility
if you get this error

Warning: Cannot modify header information - headers already sent by

then it means you have printed something before the header,
0
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
Comment Utility
Of course it will wait because you will put the HTML code of the page at the end of your PHP code.  Simplistic example below.
<?php
code here...
?>
<html>
<head>
<meta http-equiv="refresh" content="5;url=http://example.com/" />
</head>
<body>
<h1>Finished!</h1>
</body>
<html>

Open in new window

0
 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
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
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now