Guest Posted April 2, 2006 Posted April 2, 2006 Hi, i have just encountered a problem with my setup of Oscommerce in that for some reason the database server is currently not responding, it gave this message when i tried to access it through PHPMyAdmin:- #2003 - The server is not responding . When trying to access the catalog or admin, I just get a "Warning: mysql_connect(): Can't connect to MySQL server". It has made me think that if anyone wanted to view my site, they would not be too pleased if they were confronted with the above message, so does anyone have an addition for Oscommerce, or even a separate PHP script that can be used to firstly detect if the database server is functioning, and then if it is redirect on to my catalog, or if not redirect on to a custom error page that I can write in HTML to notify that the website is currently unavailable. I guess it won't make much difference if the person was half way through viewing my website, but maybe someone might like to think about including some kind of redirection or editable error pages within the catalog setup. Nothing more embarrassing than seeing your fully funtioning site suddenly throwing up error messages that don't mean a thing to visitors and only serve to confuse and put off customers. :rolleyes:
dynamoeffects Posted April 2, 2006 Posted April 2, 2006 You can change the error message that's displayed in /catalog/includes/application_top.php The line looks like this: tep_db_connect() or die('Unable to connect to database server!'); Change it to something like this: tep_db_connect() or die('Our apologies, but we\'re currently experiencing technical difficulties. Our site will be back up shortly. Thank you for your patience.'); Be sure to write all apostrophes with a prepending \ like in the example above. Please use the forums for support! I am happy to help you here, but I am unable to offer free technical support over instant messenger or e-mail.
boxtel Posted April 2, 2006 Posted April 2, 2006 You can change the error message that's displayed in /catalog/includes/application_top.php The line looks like this: tep_db_connect() or die('Unable to connect to database server!'); Change it to something like this: tep_db_connect() or die('Our apologies, but we\'re currently experiencing technical difficulties. Our site will be back up shortly. Thank you for your patience.'); Be sure to write all apostrophes with a prepending \ like in the example above. you should never use die. you should catch the sql errors (all of them) in their functions and redirect to a normal site down page as well as sending you as owner an email to the effect otherwise "back up shortly" may be very relative. Treasurer MFC
Recommended Posts
Archived
This topic is now archived and is closed to further replies.