cgosbee
Posts: 23
|
| Posted: 08/21/2008, 11:57 AM |
|
I have a project in which I have a Header page that I include in every page.
In this header, I want to test if my database connection is functional. If it isn't, I redirect (using header("Location: etc")) to a page indicating a database issue, and provide some information to the user. If it is available, the system carries on normally.
The test of the database connection works fine, and is quick when the database is accessible, so no problems there. It is slow when the database is not accessible, but I can live with that.
MOST of the time, the redirect works just fine. SOME of the time, however, rather than redirecting, the page the user tried to go to is run, and the automatic output of odbc_connect function - which I suppress in my own test and redirect functionality - is displayed.
It seems to me that my included header's redirect normally runs before anything on the page the user is trying to go to does. Obviously, because of the database error, some pages reach their first query before my header gets to perform the necessary redirect.
Can anyone provide any insight into this?
|
 |
 |
|