Location: PHPKode > projects > SHOUTcast Management Interface > smi-0.3.4/install/dbtest.php
<?
////////////////////////////////////////////////////////////////////////
/*SMI - SHOUTcast Management Interface
A web based shoutcast server management program
Founding Author: Scott D. Harvanek <hide@address.com>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.*/
////////////////////////////////////////////////////////////////////////
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>
Database Test
</title>
</head>
<body>
<?
$hostname = $_GET['host'];
$username = $_GET['uname'];
$password = $_GET['dbpass'];
$database = $_GET['database'];

$link = mysql_connect($hostname, $username, $password) or $db_error = mysql_error();
    if (!$db_error) {
    $alert = 'Connection Succes!';
    } else {
    $alert = 'Connection Failed!' . mysql_error();
    }
echo 'Testing connection: ' . $alert . '<br>';

$alert2 = mysql_select_db($database, $link);
if (!$alert2) {
    $alert2 = mysql_error();
} else {
$alert2 = 'Success';
}
echo 'Testing database: ' . $alert2 . '<br>';
?>

</body>
</html>
Return current item: SHOUTcast Management Interface