程序题找错误
来源:互联网 发布:集中采购软件 编辑:程序博客网 时间:2024/04/29 20:42
<?
/*
用户登陆程序
找出程序中的错误
*/
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 "<script>alert("登陆失败")</script>"
}else{
header("locaton:index.php");
}
}
?>
<!--form表单start-->
<script>
function check(){
if(document.s1.username.length==0){
alert("请输入字符");
return false;
}else{
return ture;
}
}
</script>
<form action="" method="POST" onsubmit="check()" name="s1">
<p>姓名:<input type="text" name="username">
<p>密码:<input type="text" name="password">
<p>密码:<input type="submit" name="submit" value="提交">
</form><!--end-->
/*
用户登陆程序
找出程序中的错误
*/
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 "<script>alert("登陆失败")</script>"
}else{
header("locaton:index.php");
}
}
?>
<!--form表单start-->
<script>
function check(){
if(document.s1.username.length==0){
alert("请输入字符");
return false;
}else{
return ture;
}
}
</script>
<form action="" method="POST" onsubmit="check()" name="s1">
<p>姓名:<input type="text" name="username">
<p>密码:<input type="text" name="password">
<p>密码:<input type="submit" name="submit" value="提交">
</form><!--end-->
- 程序题找错误
- 新手如何找程序错误
- 找错误
- 找错误
- 找错误
- 找程序
- 帮忙找错误!
- 如何找错误日志
- 找错误的方法
- 士兵突击和如何在程序里面找最弱智的错误
- 南京找程序师傅
- 程序找BUG
- 找出口程序
- 找增强程序
- 找素数程序
- 找不同程序
- 百度笔试查错题,n多错误,慢慢找吧
- 帮我找下错误
- 修改注册表
- [FAQ]VC常见问题★强烈推荐
- 上传一个浏览器版本
- ppt模版设计完成之后导入方式:
- struts2.0的标签学习
- 程序题找错误
- WIN32编程必知:__stdcall,__cdecl,__fastcall,thiscall,naked call
- 什么是CPI指数
- [ABAP Part TWO] Program Development Phase 2 - Your Coding Style Define The Quality
- 单件(Singleton)模式在php5中的实现
- STL中的常用的vector,map,set,sort用法笔记(转)
- dataGridView添加行号
- 大陆最惧怕的世界名言
- fatal error LNK1169: 找到一个或多个多重定义的符号[转]