嗨,我正在就上述问题 LINE 66 寻求一些帮助。我可以看到有几个 mysql 用户遇到了与我相同的问题,但在尝试了解决方案之后,似乎错误仍然存在。这是我的代码。
check_login.php
if(isset($_POST['submit']) && !empty($_POST['submit']))
{
$stmt2= oci_parse($conn, "SELECT * FROM user1 WHERE id = '".$_POST['id']."' ")or die(oci_error());
$check2 = oci_execute($stmt2);
//Gives error if user dosen't exist
//$check3 = oci_num_rows($check2); <-- if I uncomment this, it will result in an error too.
if (!$check2) //it supposely if($check3<0)
{
header('location: index.php?error=10');
exit();
}
else
{
while($info2=oci_fetch_array($check2)) // <----- Error in this line (line 66).
{
$pass=$info2['password'];
//gives error if the password is wrong
if ($_POST['password'] != $pass)
{
header('location: index.php?error=14');
exit();
}
else
{
// if login is ok then we add a cookie
$_SESSION['id'] = $_POST['id'];
$_SESSION['password'] = $_POST['password'];
$hour = time() + 86400;
setcookie(ID_site, $_SESSION['id'], $hour);
setcookie(Pass_site, $_SESSION['password'], $hour);
//then redirect them to the members area
if ($info2['role']=='admin')
{
header('Location: homeAdmin.php');
}
elseif ($info2['role']=='staff')
{
header('Location: homeStaff.php');
}
elseif ($info2['role']=='student')
{
header('Location: homeStudent.php');
}
else
{
header('Location: index.php');
}
} //end else
} //end while
}//end else
}// end if submit
else
{
header('Location: index.php');
}