Hello.
I want to display a message "You haven't selected a file" pause and then re-direct the user.
I'm using sleep(2) but can't then use a header() because content has already been sent to the browser.
I assume output-buffering is the way to go, but am struggling to get it to work? Thanks, Andy.
Pause and re-load
Moderator: General Moderators
Re: Pause and re-load
Use the meta refresh tag
Code: Select all
<meta http-equiv="refresh" content="2;url=http://example.com">Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Re: Pause and re-load
Thanks for your response.
Shouldn't a meta tag occur within the head tag? I'm trying to re-direct the user after an error message within the page.
I'll try it anyway.
(I've found a Javascript solution, but I was hoping to get a PHP header() and output-buffering combination to work.) Ta, Andy.
Shouldn't a meta tag occur within the head tag? I'm trying to re-direct the user after an error message within the page.
I'll try it anyway.
(I've found a Javascript solution, but I was hoping to get a PHP header() and output-buffering combination to work.) Ta, Andy.
Re: Pause and re-load
Yes, but you can generate the head tag before the message is displayed. A page is requested at once and the result would be sent to the browser at the same time.
So, what would happen is, the user would see the message, wait two seconds, then be redirected.
Meta refresh is ideal for this situation. Javascript won't always work, and output buffering with the redirect would be overkill.
So, what would happen is, the user would see the message, wait two seconds, then be redirected.
Meta refresh is ideal for this situation. Javascript won't always work, and output buffering with the redirect would be overkill.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.