📄 install.php
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>ajax im - installation</title>
</head>
<body style="background-color:#f0f0f0;">
<div style="margin:0.5% auto 0 auto;width:90%;padding:0.5%;font-family:Tahoma,Verdana,Arial,sans-serif;font-size:32px;text-align:center;">ajax im installation</div>
<div style="margin:2% auto 0 auto;width:90%;padding:1.5%;border:2px solid #444;font-family:Tahoma,Verdana,Arial,sans-serif;font-size:16px;text-align:center;">
<?
if($_GET['configured'] == '') {
?>
Did you edit <b>config.php</b> to match your MySQL configuration?<br /><br />
<a href="?configured=yes">Yes</a> <a href="?configured=no">No</a>
<?
} else if($_GET['configured'] == 'no') {
?>
Please edit <b>config.php</b> before continuing!
<?
} else {
require 'config.php';
$link = mysql_connect($sql_host, $sql_user, $sql_pass);
mysql_select_db($sql_db);
$table_messages = 'CREATE TABLE `'.SQL_PREFIX.'messages` ( `recipient` text, `sender` text, `message` text, `type` text, `stamp` text, `id` bigint(20) unsigned NOT NULL auto_increment, UNIQUE KEY `id` (`id`) ) ;';
if(!mysql_query($table_messages)) {
if(mysql_errno() == 1050) {
print "Table '".SQL_PREFIX."messages' already exists! If you had a version of ajax im less than 3.0 installed on this database, please delete the table and then run this script again, otherwise ignore this error.<br><br>\n";
$problem = true;
} else {
print("<b>A MySQL error occured:</b> (" . mysql_errno() . ") " . mysql_error() . "<br><br>\n");
$error = true;
}
} else {
mysql_query('ALTER TABLE `'.SQL_PREFIX.'messages` CHANGE `message` `message` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL');
print "Table '".SQL_PREFIX."messages' added successfully!<br><br>\n";
}
$table_users = 'CREATE TABLE `'.SQL_PREFIX.'users` ( `username` text, `password` text, `email` text, `buddylist` text, `is_online` int(11) default \'0\', `last_ping` text, `id` bigint(20) unsigned NOT NULL auto_increment, UNIQUE KEY `id` (`id`) ) ;';
if(!mysql_query($table_users)) {
if(mysql_errno() == 1050) {
print "Table '".SQL_PREFIX."users' already exists!<br><br>\n";
} else {
print("<b>A MySQL error occured:</b> (" . mysql_errno() . ") " . mysql_error() . "<br><br>\n");
$error = true;
}
} else {
print "Table '".SQL_PREFIX."users' added successfully!<br><br>\n";
}
$table_chats = 'CREATE TABLE `'.SQL_PREFIX.'chats` ( `room` text, `user` text, `id` bigint(20) unsigned NOT NULL auto_increment, UNIQUE KEY `id` (`id`) ) ;';
if(!mysql_query($table_chats)) {
if(mysql_errno() == 1050) {
print "Table '".SQL_PREFIX."chats' already exists! If you had a version of ajax im less than 3.0 installed on this database, please delete the table and then run this script again, otherwise ignore this error.<br><br>\n";
$problem = true;
} else {
print("<b>A MySQL error occured:</b> (" . mysql_errno() . ") " . mysql_error() . "<br><br>\n");
$error = true;
}
} else {
mysql_query('ALTER TABLE `'.SQL_PREFIX.'chats` CHANGE `room` `room` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL');
print "Table '".SQL_PREFIX."chats' added successfully!<br><br>\n";
}
mysql_close();
?>
<b style="color:#ff0000;">
<?
if($error == true) {
print 'An error occured while trying to setup the database tables! Please check your settings in <i>config.php</i> and then run this script again.';
} else if($problem == true) {
print 'There was a problem while setting up some of the tables. Please see the above error.';
} else {
print 'ajax im was installed successfully -- you may register and login <a href="./">here</a>. Please be sure to delete <i>install.php</i> immediately!';
}
}
?>
</b>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -