Go Back   The UNIX and Linux Forums > Special Forums > Web Programming


Web Programming Discuss Web Programming and Web Server Administration, including LAMP, Apache, MySQL, HTML, SEO, and other Web APIs and topics.

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 10-11-2012
Registered User
 
Join Date: Oct 2012
Location: Nashville, TN
Posts: 45
Thanks: 6
Thanked 0 Times in 0 Posts
SQL db check

Ive debated this for awhile after I ran into a crap load of issues with my hosting's SQL server. I was curious to know if there is a way to write a db check into my .htaccess file that would verify if a connection is present and if not transfer to another domain?? I know it can be done manually in Cpanel (domain fowarding) but I would like a way for this to be into play instead of SQL errors. Ideas??
Sponsored Links
    #2  
Old 10-11-2012
Mead Rotor
 
Join Date: Aug 2005
Location: Saskatchewan
Posts: 16,407
Thanks: 492
Thanked 2,538 Times in 2,421 Posts
Which SQL?

But probably no. That's the sort of thing you'd do in PHP. If you can check before PHP actually outputs anything, you can dump a header() to redirect then quit if the SQL doesn't work.
Sponsored Links
    #3  
Old 10-11-2012
Registered User
 
Join Date: Oct 2012
Location: Nashville, TN
Posts: 45
Thanks: 6
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Corona688 View Post
Which SQL?

But probably no. That's the sort of thing you'd do in PHP. If you can check before PHP actually outputs anything, you can dump a header() to redirect then quit if the SQL doesn't work.
I actually found something like that written in PHP but i didnt like how it required you to enter the db name, password, and user. I thought that would be a major security risk.

It was here
    #4  
Old 10-11-2012
Mead Rotor
 
Join Date: Aug 2005
Location: Saskatchewan
Posts: 16,407
Thanks: 492
Thanked 2,538 Times in 2,421 Posts
Yes, that one would be.

Hardcode your own simple one with fixed connection details and it won't be vulnerable to injection.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Perl code to check date and check files in particular dir ajaypatil_am Shell Programming and Scripting 1 07-05-2012 08:29 AM
check in and check out comments saku Shell Programming and Scripting 0 02-08-2012 02:00 AM
Check EOF char in Unix. OR To check file has been received completely from a remote system alexalex1 UNIX for Advanced & Expert Users 5 07-22-2010 07:48 PM
script to check if another script is running and if so, then sleep for sometime and check again mathews Shell Programming and Scripting 2 07-21-2010 11:25 PM
Script to check for a file, check for 2hrs. then quit mmarsh UNIX for Dummies Questions & Answers 2 09-16-2005 02:46 PM



All times are GMT -4. The time now is 01:52 PM.