Avatar of Paul Konstanski
Paul Konstanski
Flag for United States of America asked on

PHP header auto refresh doesn't always work

I have a login script where I do some integrity testing for the user submission. If all is fine, I set a session variable and do a refresh.  The code looks like this:

       $url = "https://mysite.com/index.php";
	header('refresh: 0; url='.$url); 
	exit; // to keep the rest of the form from continuing

Open in new window


What happens every once and a while (like 1 in 100) is that the auto refresh doesn't fire and since there isn't any text on the page it appears as if the page has frozen.

I just added this line which at least puts something up on the person's page. Otherwise all they got was a "white screen of death"...
      print 'Your page should auto refresh in two seconds. If not, please click this link: <a href="'.$url.'">'.$ur2.'</a>';

So now people at least see something other than the white screen.

Any insight on how to fix this so that it fires for everybody?
HTMLPHP

Avatar of undefined
Last Comment
Gary

8/22/2022 - Mon
SOLUTION
Ray Paseur

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.
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.
SOLUTION
Ray Paseur

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
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Gary

I've requested that this question be closed as follows:

Accepted answer: 500 points for Dave Baldwin's comment #a40427000

for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck