php 代码如下 运行结果没有验证账号和密码 任何账号和密码都是成功登入,但是他并不跳转到指定页面上去
<?phpsession_start();?><formid="form1"name="form1"method="post"action=""><divid="Laye...
<?php
session_start();
?>
<form id="form1" name="form1" method="post" action="">
<div id="Layer1">
<table width="525" height="240" border="0">
<tr>
<td width="155" height="55"> </td>
<td width="354"><label>
<input type="text" name="name"value="" />
</label> </td>
</tr>
<tr>
<td> </td>
<td><label>
<input type="password" name="pwd" value=""/>
</label> </td>
</tr>
<tr>
<td><label>
<input type="submit" name="Submit" value="提交" onclick="return f_check(form);" />
</label>
</td>
<td><label>
<input type="submit" name="Submit2" value="重填" />
<?php
include ("conn/conn.php");
if(isset($_POST['name'])and $_POST['pwd']!=null){
$select=mysql_query("select * from tb_user where name='".$name."'and pwd='".$pwd."'");
if($row=mysql_num_rows($select)==1){
$_SESSION['name']=$_POST['name'];
echo "<script>alert ('登入成功!');windoow.location.href='sheji/teacher.php';</script>;";
}else{
echo "<script>alert ('对不起,您输入的用户名或密码不正确!');windoow.location.href='sheji/login.php';</script>;";
}
}
?>
</label></td>
</tr>
</table>
</div>
</form>
</td>
</tr>
</table>
</body>
</html> 展开
session_start();
?>
<form id="form1" name="form1" method="post" action="">
<div id="Layer1">
<table width="525" height="240" border="0">
<tr>
<td width="155" height="55"> </td>
<td width="354"><label>
<input type="text" name="name"value="" />
</label> </td>
</tr>
<tr>
<td> </td>
<td><label>
<input type="password" name="pwd" value=""/>
</label> </td>
</tr>
<tr>
<td><label>
<input type="submit" name="Submit" value="提交" onclick="return f_check(form);" />
</label>
</td>
<td><label>
<input type="submit" name="Submit2" value="重填" />
<?php
include ("conn/conn.php");
if(isset($_POST['name'])and $_POST['pwd']!=null){
$select=mysql_query("select * from tb_user where name='".$name."'and pwd='".$pwd."'");
if($row=mysql_num_rows($select)==1){
$_SESSION['name']=$_POST['name'];
echo "<script>alert ('登入成功!');windoow.location.href='sheji/teacher.php';</script>;";
}else{
echo "<script>alert ('对不起,您输入的用户名或密码不正确!');windoow.location.href='sheji/login.php';</script>;";
}
}
?>
</label></td>
</tr>
</table>
</div>
</form>
</td>
</tr>
</table>
</body>
</html> 展开
2个回答
展开全部
没有验证账号和密码:f_check(form)这个函数呢?
不跳转是因为:windoow拼错了
不跳转是因为:windoow拼错了
追问
大神 有QQ号码 我下次有不会的请教您!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询