<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>登录angularJS</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/login.css" />
</head>
<body>
<div class="container">
<div class="img-responsive"></div>
<form class="form-signin" id= "form1" method="post" action="login.php">
<h2>Please sign in</h2>
<label class="sr-only" for="inputEmail" >Email address</label>
<input id="inputEmail" class="form-control" placeholder="Email address" required=""
autofocus="" type="email" name="email"/>
<label class="sr-only" for="inputPassword" >Password</label>
<input id="inputPassword" class="form-control" placeholder="Password" required=""
autofocus="" type="password" name="password"/>
<div class="checkbox">
<label>
<input value="rember-me" type="checkbox" />
Remeber me
</label>
</div>
<button class="btn btn-lg btn-primary btn-block">Sign in</button>
</form>
</div>
</body>
</html>
<?php
header("content-type:text/html;charset=utf-8");
/* $mysql_username="localhost"; // 连接数据库用户名
$mysql_password=""; // 连接数据库密码*/
$mysql_database="test"; // 数据库的名字
// 连接到数据库
$conn = mysql_connect(‘localhost‘,‘root‘,‘‘) or die("MYSQL_connect:".mysql_errno());
mysql_select_db($mysql_database);
$email=$_POST[‘email‘];
$password=$_POST[‘password‘];
if(isset($email)){
$sql = "INSERT INTO `login` VALUES (‘$email‘,‘$password‘)";
$query = mysql_query($sql);
if($query){
echo ‘1‘;
}else{
echo ‘注册失败!‘;
}
}
?>