Location: PHPKode > projects > phpSC > install/install2.php
<?PHP
session_start();
if(isset($_GET['connect'])) {
$host = $_POST['host'];
$username = $_POST['user'];
$_SESSION['mysql_host'] = $_POST['host'];
$_SESSION['mysql_user'] = $_POST['user'];
$_SESSION['mysql_pass'] = $_POST['password'];
$password = $_POST['password'];
if($_POST['user'] == "") {
$username = "<i>BLANK</i>";
}
if($_POST['password'] == "") {
$password = "<i>BLANK</i>";
}

$conn = mysql_connect($_POST['host'],$_POST['user'],$_POST['password']);
if($conn) {
$continue = 1;
}
else
{
$message = "I couldn't connect to the MySQL server with the information you specified.";
echo mysql_error($conn);
$continue = 0;
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<?PHP
if($continue == 1) {
?>
<p align="center"><strong>Step 2,  Part 2 : MySQL Verified </strong><br />
</p>
<form method="post" action="install3.php">
  <div align="center">
    <table width="300" border="0">
      <tr>
        <td width="146"><div align="right">IP / Domain Name: </div></td>
        <td width="144"><div align="center"><strong>
          <?= $host ?>
        </strong></div></td>
      </tr>
      <tr>
        <td><div align="right">Username:</div></td>
        <td><div align="center"><strong>
          <?= $username ?>
        </strong></div></td>
      </tr>
      <tr>
        <td><div align="right">Password:</div></td>
        <td><div align="center"><strong>
          <?= $password ?>
        </strong></div></td>
      </tr>
    </table>
    <label></label>
  </div>
  <p align="center">
    <input type="submit" name="Submit2" value="Step 3: Configure Admin Account -&gt;" />
  </p>
  <p align="center"><?= $message ?></p>
</form>
</p>
<?PHP
}
else
{
?>
<p align="center"><strong>Step 2 : MySQL Database Connection </strong><br />
  This next check is a two part test. The first part will ask you for a few details about your MySQL Server.</p>
<form method="post" action="install2.php?connect">
  <div align="center">
    <table width="300" border="0">
      <tr>
        <td width="146"><div align="right">IP / Domain Name </div></td>
        <td width="144"><input name="host" type="text" id="host" value="localhost" /></td>
      </tr>
      <tr>
        <td><div align="right">Username</div></td>
        <td><input name="user" type="text" id="user" /></td>
      </tr>
      <tr>
        <td><div align="right">Password</div></td>
        <td><input name="password" type="text" id="password" /></td>
      </tr>
    </table>
    <label></label>
  </div>
  <p align="center">
    <input type="submit" name="Submit2" value="Part Two" />
  </p>
  <p align="center"><?= $message ?></p>
</form>
</p>
<?PHP
}
?>

Return current item: phpSC