Page 1 of 1
Page redirection problem?
Posted: Sun Mar 30, 2008 5:07 pm
by AMCH
Hi,
I am having a problem that appears to be occurring randomly and I am not sure exactly why. When certain pages that are php handler pages are being navigated to upon form submission they are occasionally showing as a completely white page.
The pages seem to load and then are “done” loading as far as the browser is concerned. They are supposed to run and then after doing the code on them they are supposed to redirect the user to other pages using the “header” and in some cases “META” method of redirection.
90% of the time it actually works perfectly by redirecting the user to the required page but occasionally there is the above stated problem.
Since it appears to be occurring randomly I have thought that the trigger stimulus must be random too, such as connection speed for instance?
Can anyone make any suggestions as to what might be causing this problem?
Much Appreciated
AMCH

Re: Page redirection problem?
Posted: Sun Mar 30, 2008 6:25 pm
by Christopher
You probably have PHP error and error_reporting is turned off. Either check the logs or turn error_reporting On
Re: Page redirection problem?
Posted: Sun Mar 30, 2008 6:57 pm
by AMCH
arborint wrote:You probably have PHP error and error_reporting is turned off. Either check the logs or turn error_reporting On
Thanks for replying.
Error reports are turned on. If there were errors then it would never work as nothing is actually changing as far as the code is concerned since something that works one second fails to work the next despite all variables being identical etc. It really is random.
Any more suggestions?
With thanks in anticipation.
AMCH

Re: Page redirection problem?
Posted: Mon Mar 31, 2008 4:57 am
by EverLearning
I once got white pages using
when $url was for some reason undefined.
These are questions that come to my mind:
Do you have "exit()" after "header()", to prevent further execution of code?
Are you sure that white pages showing are completely random? Maybe they appear on some specific combinations of entered form data (Just reread your post, and you said that you're using identical data so I guess it's not that

).
Have you looked in php error log, maybe there is something there?
Also, you said redirect is done sometimes using "header" and sometimes "META" method. Does you problem appear when you're using "header" or "META"?
Re: Page redirection problem?
Posted: Mon Mar 31, 2008 8:21 am
by kryles
have you used print or echo to make sure you are where you expect to be? Misleading else if's can lead you to something with no code and thus white. At least it has happened to me before lol
Re: Page redirection problem?
Posted: Mon Mar 31, 2008 6:09 pm
by AMCH
EverLearning wrote:I once got white pages using
when $url was for some reason undefined.
These are questions that come to my mind:
Do you have "exit()" after "header()", to prevent further execution of code?
Are you sure that white pages showing are completely random? Maybe they appear on some specific combinations of entered form data (Just reread your post, and you said that you're using identical data so I guess it's not that

).
Have you looked in php error log, maybe there is something there?
Also, you said redirect is done sometimes using "header" and sometimes "META" method. Does you problem appear when you're using "header" or "META"?
Hi, thanks for reply.
I do use die() after header() to prevent further execution. The problem seems to occur when using both header and META.
Any more ideas?
Much appreciated guys! Thanks for all replies.

Re: Page redirection problem?
Posted: Mon Mar 31, 2008 6:17 pm
by s.dot
You cannot use header('Location: ...') in php and meta refresh in HTML, if I am understanding you correctly. You have to do one or the other.

Re: Page redirection problem?
Posted: Tue Apr 01, 2008 3:13 am
by AMCH
scottayy wrote:You cannot use header('Location: ...') in php and meta refresh in HTML, if I am understanding you correctly. You have to do one or the other.

Hi,
Thanks for reply.
I have used them on different scripts, not on the same one.
lol

Re: Page redirection problem?
Posted: Tue Apr 01, 2008 3:36 am
by EverLearning
Have you tested this on different browsers, different servers? Maybe it's something specific to your environment that's causing the problem.
Re: Page redirection problem?
Posted: Tue Apr 01, 2008 4:56 am
by AMCH
EverLearning wrote:Have you tested this on different browsers, different servers? Maybe it's something specific to your environment that's causing the problem.
I have tested on IE and Moz FF, same problem on both. I also noticed that occassionally the phpbb3 forum that I setup on the same server is doing the same thing, which would suggest it's nothing to do with my code. I do not know if any of my users experience the problem because we are testing at the moment but time will tell.
Could a server related issue cause this?
Could a weak connection in my office cause this on my local machine?
Cheers for help
AMCH
Re: Page redirection problem?
Posted: Tue Apr 01, 2008 5:35 am
by EverLearning
It seems to be a server issue, by your account.
There is a possibility that PHP process has exhausted its available memory(I think that should be in the PHP error log, but I'm not sure).
You can try using
Live HTTP headers FF extension, to monitor the HTTP headers flow to see if everything is as it should be.
Re: Page redirection problem?
Posted: Tue Apr 01, 2008 5:37 am
by EverLearning
Also look through your web server logs.