Redirecting user

admin

Administrator
Staff member
I\'m trying to redirect the user to a \"sorry page\", when the connection or any DB operation fails...

Well, I tried to use the \'header\' function checking IF the variable used to assign the connection string is empty... something like:

$connection = (\"//the hole thing to connect to mysql\") or die (\"//error message\");

if (!$connection) {

header (\"//the URL to my \'sorry page\"\');
exit;
}

It doesn\'t works because PHP stops immediataly and shows the \"die\" message when MySql is down But I don\'t wnato to show this to the user, wright?

Well, would someone please help me?

Thanx a lot,

Ricardo Leite
 
Back
Top