login.php

来自「php会员管理地模块设计。需要地同志可以直接拿来应用于自己地网站建设」· PHP 代码 · 共 21 行

PHP
21
字号
<!---Login php srcipt begins here--->
<?
mysql_connect("localhost", "root", "")
	or die ("Unable to connect to server.");
mysql_select_db("secretDB")
	or die ("Unable to select database.");
$sql = "SELECT id
	FROM users
	WHERE username='$username' and password='$password'";
$result = mysql_query($sql)
	or die ("Unable to get results.");
$num = mysql_numrows($result)
	or die ("You're not authorized to be here.  If you feel you have recieved this
message in error, please contact the <a
href=\"mailto:tyler.longren@midiowa.net\">webmaster</a>");
if ($num == 1) {
echo "<p>You can be here<br>";
echo "Your username is $username</p>";
}
?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?