Guest Posted March 22, 2006 Posted March 22, 2006 Yesterday my data base server went down. When I tried to access my web page as a customer I got an error page which showed the path to my database.php If this happens I would like to redirect customers to a custom error page for example error_page.html I have searched the forums and came a step closer to a fix but not all the way: In includes/application_top.php I replaced: tep_db_connect() or die('Unable to connect to database server!'); With: tep_db_connect() or tep_redirect('http://www.mysite.com/error_page.html'); Unfortunally this didn?t work and gave me the following error: Fatal error: Call to undefined function: tep_redirect() in.....path to my application_top.php Does anybody have a solution for this? Thanks in advance. /Per
kgt Posted March 22, 2006 Posted March 22, 2006 tep_db_connect() or header('Location:http://www.mysite.com/error_page.html'); Contributions Discount Coupon Codes Donations
Guest Posted March 22, 2006 Posted March 22, 2006 tep_db_connect() or header('Location:http://www.mysite.com/error_page.html'); Thanks for your reply. I just tried it and it doesn?t work. It gave me all sorts of errors. One of the errors was this one: Warning: Cannot modify header information - headers already sent by (output started at....path to my database.php Anything else I can try?
aarslanturk Posted March 7, 2007 Posted March 7, 2007 open includes/functions/database.php Change this: if (USE_PCONNECT == 'true') { $$link = mysql_pconnect($server, $username, $password); } else { $$link = mysql_connect($server, $username, $password); } to this: if (USE_PCONNECT == 'true') { $$link = mysql_pconnect($server, $username, $password); if ($$link == 0) { header('Location: error_page.html'); // and you want print error or anything else } } else { $$link = mysql_connect($server, $username, $password); if ($$link == 0) { header('Location: error_page.html'); // and you want print error or anything else } }
Recommended Posts
Archived
This topic is now archived and is closed to further replies.