PHP 用户登录

PHP.用户登录的一段笔记,呵呵 php

<body>
<?php
$name = $_REQUEST['name'];
$password = $_REQUEST['password'];
$sql = "select * from users where name='$name' and password='$password'";
mysql_connect('localhost','root','123');
mysql_select_db('te');
$result=mysql_query($sql);
if(mysql_num_rows($result)>=1){
?>
<h1><?php echo $name ?>,<span class="STYLE1">欢迎你!</span><a href="comment.html">
进入咱们的网上留言本>>></a></h1>
<a href="#">
<?php
}
else{?>
</a>
<p>您的用户名或密码不正确,<a href="login.html">请返回从新登陆>>;</a></p>
<?php }?>
 <?php mysql_close();?>
</body>html

但愿能帮到你们,本身也在复习ing ..mysql