报名电话: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-->
相关阅读:
- 什么是php (qaz9876, 2008-2-25)
- PHP有关的技术 (qaz9876, 2008-2-25)
- php页面设计 (nnn10000, 2008-2-27)
- php规范4 (nnn10000, 2008-2-27)
- PHP语言教父炮轰Java:已输掉Web之战 (joejoe0332, 2008-4-15)
- ThinkSNS携逛啦发展中国PHP开源事业 (joejoe0332, 2008-4-21)
- Netbeans 6.1在预览版中首增PHP支持 (joejoe0332, 2008-5-09)
- PHP 6开源新版发布前新特性大展望 (joejoe0332, 2008-5-12)
- 追踪PHP最新进展:Zeev Suraski访谈录 (joejoe0332, 2008-5-20)
- 开源新版NetBeans让PHP开发更轻松 (joejoe0332, 2008-5-23)
导入论坛
收藏
分享给好友
管理
举报
TAG:
php