Hey there everybody, I'm new to PHP, but i have a mediocre knowledge. I am coding a simple login module to learn more of the functions etc. Its going very well, everything is set up just like i would want it, except for one thing.. I have messages on each page before they redirect.. Such as, "you didn't enter a password. please try again." but, you cannot read them for more than a half second, because the page changes too fast. I know i could use the sleep() function to make a delay between the pages, but it wasn't working out for me too well, and seemed to be useless. Does anyone else have ideas? Thanks.. And i know, you might say "search google" but i already have, and found absolutely nothing that worked.. Thanks again everyone!
It sounds like you're using a meta refresh to redirect, use something like this: <meta http-equiv="refresh" content="4;URL=redirectlocation.html"/> Code (markup): Where you change "4" to however many seconds you want to delay the redirect by.
Thanks for the ideas.. but none of them will work in my situation, because the code i am doing is before the header tag (thats where meta goes) and i can't resend the headers. I am going to try to use the sessions method.. Thanks Again!
I never tried it before, but you have a sleep() function in PHP, maybe combining that with header() or javascript window.location you can achieve what you need.
It's a typo. It should be refresh: 5 ; URL=... Thanks. No, you can do the redirection at anytime. Just put ob_start(); at the most top of the file (before any output, usually after the <?php) - ads2help
Do a fast redirect to a inbetween redirect page that will display your message passing any information to that inbetween page you need. In the header meta portion of that inbetween page you put <meta http-equiv="refresh" content="4;URL=http://site.com/PLACETOREDIRECTTHEM.html"/> Have you seen the page that is shown to you when logging into digitalpoint.com forums? It says you will be redirected after a short period of time. This is how I am explaining to do it. With that header meta data it will wait X amount of seconds before going to the next page.
An open Apache child process uses 8M+ of real RAM. That adds up. If you'd had to manage servers that are in heavy use you'd feel my pain on seeing that sleep() call.