报名电话:68987071;13501018351;15810068603。 报名QQ:152588943;42908271;11986302。 电子邮箱:php@globehr.com。 联系人:战老师,迟老师。提前一天报名,座位有限,报满即止 http://php.globehr.com/

程序题找错误

上一篇 / 下一篇  2008-05-26 10:15:54

<?
/*
用户登陆程序
找出程序中的错误
*/
if($_post){
$host="localhost";//
$port=3306;
$usr="pphoo";
$pasword="090909";
$db="xiangmu";
$table="xm_note"
$link=mysql_connect($host,$usr,$pasword)  ;
if(!$link) exit("数据库连接失败");
if(!mysql_select_db($db,$link)) exit("数据库选择失败");
@mysql_query("SET NAMES gb2312");
 $username=($_post['username']==ff)?"fffffff":$_post['username']
  $password=md5 $_post['password']
    $sql="select  count(1)  as num from $table  where `username`= $username and `password`=$password";
 $a=mysql_fetch_array($sql);
 if($a["num"]!=0){
 echo "<scrīpt>alert("登陆失败")</scrīpt>"
 }else{
 header("locaton:index.php");
 }
}
?>
<!--form表单start-->
<scrīpt>
function check(){
if(document.s1.username.length==0){
alert("请输入字符");
return false;
}else{
 return ture;
}
}
</scrīpt>
<form action="" method="POST" ōnsubmit="check()" name="s1">
 <p>姓名:<input type="text" name="username">
 <p>密码:<input type="text" name="password">
 <p>密码:<input type="submit" name="submit" value="提交">
</form><!--end-->

TAG: php

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2008-10-12  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 785
  • 日志数: 41
  • 建立时间: 2008-05-23
  • 更新时间: 2008-07-22

RSS订阅

Open Toolbar