【发布时间】:2014-12-29 04:19:08
【问题描述】:
注意:未定义索引:C:\xampp\htdocs******.php 中的电子邮件在线 14
注意:类 mysqli_result 的对象无法转换为 int in C:\xampp\htdocs******.php 第 17 行
警告:mysqli_num_rows() 期望参数 1 为 mysqli_result, 第 17 行 C:\xampp\htdocs******.php 中给出的布尔值
注意:未定义索引:C:\xampp\htdocs******.php 中的电子邮件在线 34
<?php
if(isset($_POST['Login']))
{
$query_login = "select * from tbl_member where pass = '".md5(md5($_POST['Email']).$_POST['password'])."' and user_name = '".mysqli_real_escape_string($dbhandle, $_POST['username'])."' || email = '".mysqli_real_escape_string($dbhandle, $_POST['username'])."' and activation = '1'";
$sql_login=mysqli_query($dbhandle, $query_login);
if(mysqli_num_rows((int)$sql_login>0)){
// The log-in is OK so set the user ID and username session vars (and cookies), and redirect to the home page
$result = mysqli_fetch_array($sql_login);
$_SESSION['user_id'] = $result['id'];
$_SESSION['username'] = $result['user_name'];
setcookie('user_id', $result['id'], time() + (60 * 60 * 24 * 30));
setcookie('username', $result['user_name'], time() + (60 * 60 * 24 * 30));
$query_check = "select * from tbl_member where user_name = '".mysqli_real_escape_string($dbhandle, $_POST['username'])."' || email = '".mysqli_real_escape_string($dbhandle, $_POST['username'])."' and pass = '".md5(md5($_POST['Email']).$_POST['password'])."' and activation = '0'";
$sql_check=mysqli_query($dbhandle, $query_check);
$msg = "<font style='font-family:Arial;font-weight:bold;font-size:14px;color:red'>ERROR:-Invalid email or password !</font>";
}
}
?>
【问题讨论】:
-
我在这里没有看到任何问题,但有一堆错误。
-
您的错误日志中有足够的信息来自己调试。
-
这似乎不是问题。您可以为此使用Pastebin。