search

Home  >  Q&A  >  body text

After the administrator logs in through the username and password and submits, an error that the username and password are not defined appears.

<?php  include"config.php";//session_start();//初始化变量session$name=$_POST["name"]; $password=$_POST["password"];$sql="select * from admins where name='{$name}' and password ='{$password}'"; echo $sql;$smt=$pdo->prepare($sql);$smt->execute();$row=$smt->fetch();if($row){ $_SESSION['name']=$row['name']; echo"<script>alert('登录成功')</script>"; echo"<script>location='index.php'</script>";       }else{ echo"<script>alert('cuwu')</script>"; //echo"<script>location='denglu.php'</script>";}?>

龙虾也忧愁龙虾也忧愁2086 days ago1163

reply all(0)I'll reply

No reply
  • Cancelreply