Rumah > Artikel > pembangunan bahagian belakang > php登陆小疑点
php登陆小问题
login.php
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><script type="text/javascript"> function check() { var un = document.getElementById("username").value; var up = document.getElementById("userpass").value; if(un==""){alert("null"); return false;} if(up==""){alert("null");return false;} } </script>
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><?php include("conn.php"); ?> <?php if($_POST["submit"]) { echo $sql ="select * from users where username='".$_POST["username"]."' and userpass='".$_POST["userpass"]."'"; $result=mysql_query($sql); //echo count($result); if($result) { echo "登陆成功"; }else { echo "不要捣乱"; } } ?>