<?PHP
session_start();
?>
<?PHP
if(isset($_GET['auto'])) {
$admin_name = $_SESSION['u_name'];
$sql = "SELECT * FROM users WHERE username = '$admin_name'";
$conn = mysql_connect($_SESSION['mysql_host'],$_SESSION['mysql_user'],$_SESSION['mysql_pass']);
mysql_select_db($_SESSION['mysql_db']);
$result = mysql_query($sql,$conn);
$active = mysql_num_rows($result);
if($active == 1) {
header("Location:install6.php");
}
else
{
$continue = 2;
}
}
if(isset($_GET['check'])) {
$admin = $_SESSION['u_name'];
$_SESSION['mysql_db'] = $_POST['man_db'];
$sql = "SELECT * FROM users WHERE username = '$admin_name'";
$conn = mysql_connect($_SESSION['mysql_host'],$_SESSION['mysql_user'],$_SESSION['mysql_pass']);
mysql_select_db($_SESSION['mysql_db']);
$result = mysql_query($sql,$conn);
$active = mysql_num_rows($result);
if($active == 1) {
header("Location:install6.php");
}
else
{
$continue = 2;
}
}
?>
<div align="center">
<p align="center"><strong>Step 5: Check Database Health & Write Config File </strong><br />
This is the last step!</p>
<p align="center">
<p align="center">Since you decided to manually enter your database information, we'll need the name of the<br />database that you installed your SQL files too.<br />
<form id="form1" name="form1" method="post" action="install5.php?check">
<div align="center">
<input type="text" name="man_db" />
<input type="submit" name="Submit" value="Check DB" />
</div>
</form>
<?PHP
if($continue == 2) {
echo "There is something wrong with your database connection, please make sure ALL the SQL files were added correctly.";
}
?>