📄 config.php
字号:
<?PHP
// 数据库配置
$server = "localhost"; // 数据库服务器,一般为“localhost”
$username = "root"; // MySQL 用户名
$password = ""; // MySQL 用户密码
$database = "etk"; // 数据库名称
$DBprefix = "etk"; // 表前缀,建议不要修改
$webaddr = "http://localhost/"; //网站地址
//**************************************************************
//以下信息请勿修改
//**************************************************************
// script options:
$passwordLengthMIN = 16; // Sets the minium nubmer of characters in the password
$passwordLengthMAX = 32; // Sets the maxium number of characters in the password (max 20 chars!)
$UseMailConfirm = true; // Only set this to false if your host does not support mail()
$AllowForgotPassword = true; // Only set this to false if your host does not support mail()
$UsernameValCharOnly = true; // If set on true the user can only use usernames with A to Z, a to z, 0 to 9
$passwordValCharOnly = true; // If set on true the user can only use passwords with A to Z, a to z, 0 to 9
$allowChangePassword = true; // If set on false the user cant change passwords
$makeAdminOnlyActivate = false; // Set this to true if you want to activate al accounts by hand throught the admin screen
$allowResend = true; // Set this to false if you don't want the users to be able to have the activation code resend
// Note that the form will be visible anyway and that if $UseMailConfirm = false if wont be send either
$TripodSupport = false; // Only set this to true if you are hosted on tripod.
// ErrorStrings:
$couldNotConnectMysql = "Could not connect MySQL<BR>\n please check your settings in config.php";
$couldNotOpenDatabase = "Could not open database<BR>\n please check your settings in config.php";
$disabledFeatures = "The adminstrator of this site has disabled this feature";
$incorrectLogin = "登陆错误!";
$underAttackReLogin = "This account was under attack. Therefore it was locked. To terminate the lock log-in with you correct loginname and password. After this log-in the lock will be terminated and you can you use our account as normal<BR> NOTE: make sure you do not make any type errors. This would activate the lock again.";
$underAttackPleaseWait = "This account is under attack. Please wait an until the account is released again.";
$accountNotActivated = "您的账号还没有激活。";
$incorrectUserMailaders = "用户名或者电子邮件填写错误.";
$activationCodeHasBeenResend = "你的激活码已经发送到了您的邮箱,请查收!";
$incorrectUserActcode ="用户名或者电子邮件填写错误.请重试!";
$email_message_content = "感谢你注册[EasyTalk],你的激活码: %p";
$email_message_title = "[EasyTalk]注册激活码";
$email_message_header = "From: 用户注册";
$message_forgot_password = "你的密码:\n %p";
$title_forgot_password = "密码请求";
//**************************************************************
//以下信息请勿修改
//**************************************************************
$version= "1.1";
// if the prefix is not empty add an _ (underscore)
if ($DBprefix != ""){$DBprefix = $DBprefix . "_";}
// Code to make sure that the $database field was filled and code to connect to the database
if ($database == ""){
// Check it the database exist
$query = "use members";
// If this query is succesfull, and returns a 1. this means that the database members can be used.
// If it returns 'null' then it doesn't exist.
if (mysql_query($query) == null){
//if it doesn't exist we create it and connect to it.
$query = "CREATE DATABASE members";
$result = mysql_query($query);
if ($result == 1){
$conn = mysql_connect($server,$username,$password) or die ($couldNotConnectMysql);
mysql_select_db($database,$conn) or die ($couldNotOpenDatabase);
}else{echo "Error while creating database (Errornumber ". mysql_errno() .": \"". mysql_error() ."\")<br>";}
}
else{
// It already exist so we will connect to it.
$database= "members";
$conn = mysql_connect($server,$username,$password) or die ($couldNotConnectMysql);
mysql_select_db($database,$conn) or die ($couldNotOpenDatabase);
//echo "数据库选择成功了!";
}
}
else{
// connect or show an error.
$conn = mysql_connect($server,$username,$password) or die ($couldNotConnectMysql);
mysql_select_db($database,$conn) or die ($couldNotOpenDatabase);
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -