我对PHP和MySQL不太满意,但我的朋友需要一只手,所以我想我会试一试。
我想查看用户名(login_Name)和密码(login_Pass)是否在数据库中。
<?php
// Code Here?
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Title</title>
<link href="style/ssheet.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="header">
<img src="images/banner.png" alt="alttitle" />
</div>
<div id="content">
<div id="login">
<?php if($_GET['failed'] == 0) {echo 'Wrong username or password';} ?>
<form name="login" action="main.php" method="post">
<fieldset>
<legend>Login Form</legend>
<table>
<tr>
<td>Login Name:</td>
<td><input type="text" name="user" id="user" /></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="password" id="password" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="submit" value="Login" /></td>
</tr>
</table>
</fieldset>
</form>
</div>
</div>
</body>
</html>