Location: PHPKode > projects > phpSC > install/test.php
<?PHP
session_start();
$conn = mysql_connect($_SESSION['mysql_host'],$_SESSION['mysql_user'],$_SESSION['mysql_pass']);
$user_name = $_POST['user_name'];
$password = $_POST['user_pass'];
if($_POST['user_pass'] != $_POST['pass_check']) {
header("Location:install3.php?password");
}
$user_name = $_POST['user_name'];
echo $user_name;
$user_pass = $_POST['user_pass'];
$_SESSION['user_name'] = $user_name;
$_SESSION['user_pass'] = $user_pass;
$enc_pass = sha1($user_pass);
$sql_0 = "DROP TABLE IF EXISTS `dnas_settings`";
$sql_1 = "
CREATE TABLE `dnas_settings` (
  `id` int(11) NOT NULL auto_increment,
  `host` varchar(225) NOT NULL default '',
  `port` int(11) NOT NULL default '0',
  `password` varchar(255) NOT NULL default '',
  `name` text NOT NULL,
  `owner` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3";
$sql_2 = "
DROP TABLE IF EXISTS `users`";
$sql_3 = "
CREATE TABLE `users` (
  `id` int(11) NOT NULL auto_increment,
  `username` varchar(255) NOT NULL default '',
  `password` varchar(255) NOT NULL default '',
  `level` int(11) NOT NULL default '0',
  `email` varchar(255) NOT NULL default '',
  `ip` varchar(255) default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2";
$sql_4 = "
INSERT INTO `users` (`username`, `password`, `level`, `email`, `ip`) VALUES 
('miles', 'darkangel.2309', 101, 'NOT USED YET', NULL)";

mysql_select_db($_POST['database'],$conn);
$_SESSION['mysql_db'] = $_POST['database'];
$result = mysql_query($sql_0,$conn) or die(mysql_error());
$result = mysql_query($sql_1,$conn) or die(mysql_error());
$result = mysql_query($sql_2,$conn) or die(mysql_error());
$result = mysql_query($sql_3,$conn) or die(mysql_error());
$result = mysql_query($sql_4,$conn) or die(mysql_error());
?>
Return current item: phpSC