|
djAkYOl - Yeni sayfanın başlığı
|
|
|
|
|
|
phpregister installation
$config = array();
if(file_exists("config/config.php"))
require_once("config/config.php");
$step = $_GET["step"];
if (!$step) {
$step = 0;
}
if ($step == 0) {
?>
} // END INTRO
// BEGIN STEP TWO
if ($step == 1) {
$dbhost = $_POST["dbhost"];
$dbuser = $_POST["dbuser"];
$dbpass = $_POST["dbpass"];
$dbname = $_POST["dbname"];
$rooms = $_POST["rooms"];
$accountid = $_POST["accountid"];
$url = $_POST["url"];
if( $url[strlen($url)-1] != "/" )
$url = $url."/";
$link = mysql_connect("$dbhost", "$dbuser", "$dbpass") or die ("Cannot connect to your database at this time");
$linkdb = mysql_select_db("$dbname") or die ("Sorry, its unable to establish a connection with the database. Please check that you have set the variables correctly Unable to establish database connectionPossible Causes
- Invalid Database Name/Username/Password Specified
- Database is not running
");
// BUILD THE DATABASE
echo "Please be patient while your database is setup...";
echo "
Creating Users Table...";
$sql = "CREATE TABLE `Users` (
`Username` varchar(255) NOT NULL default '',
`Password` varchar(255) NOT NULL default '',
`Email` varchar(255) NOT NULL default '',
`Sex` tinyint(1) NOT NULL default '1',
`isAdmin` tinyint(4) NOT NULL default '0',
`Mode` tinyint(1) NOT NULL default '0',
`Invisible` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`Username`),
FULLTEXT KEY `Email` (`Email`)
) TYPE=MyISAM;";
mysql_query($sql);
echo " [ OK ] ";
echo "
Creating confirm Table...";
$sql = "CREATE TABLE `confirm` (
`confirm_id` char(32) NOT NULL default '',
`session_id` char(32) NOT NULL default '',
`code` char(6) NOT NULL default '',
PRIMARY KEY (`session_id`,`confirm_id`)
) TYPE=MyISAM;";
mysql_query($sql);
echo " [ OK ] ";
$sql = "INSERT INTO `Users` VALUES ('admin', 'admin', 'youremail@yourdomain.com', 4, 3, 0, 0);";
mysql_query($sql);
echo "
SQL Setup Complete
FINISH";
}
// END DATABASE BUILD
// BEGIN STEP TWO
if ($step == 2) {
?>
Installation
Complete |
|
Please log in with username admin and password admin |
|
You
MUST delete install.php for security reasons! |
}
?>
Teknik
|
|
|
|
|
|