CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Database connection failure redirect

Print topic Send  topic

Author Message
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?
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.