希望一切都很好。
我有两个环境,
舞台和制作。
在暂存中,代码不起作用,但是在生产中起作用。
这是我的登录代码:
ini_set("session.cookie_httponly", "True");
header('x-powered-by:');
session_start();
include "includes/header.php";
error_reporting(0);
$subflag = $_POST['subflag'];
//$flag="true";
$myval = "true";
if ($subflag == "true") {
$user_answer = $_POST[user_answer];
$answer = $_POST[answer];
if (substr(md5($user_answer), 5, 10) === $answer) {
$captcha_valid = "true";
$myval = "true";
} else {
$captcha_valid = "false";
$myval = "false";
}
if ($myval == "false") {
$errortext .= "Verification Failed";
$subflag = "false";
}
if ($myval == "true") {
$uname = $_POST[username];
$pwd = $_POST[pwd];
//$uname = trim(str_replace("|", "'", filter_var(str_replace("\'", "|", $uname), FILTER_SANITIZE_STRING)));
$pwd = trim(str_replace("|", "'", filter_var(str_replace("\'", "|", $pwd), FILTER_SANITIZE_STRING)));
$pwd = mysqli_real_escape_string($conresult, stripslashes(trim($pwd)));
$pwd = md5($pwd);
//$uname = mysqli_real_escape_string($conresult, $uname);
$queryStmt = mysql_query("LOCK TABLES loan_login WRITE");
$result1 = mysqli_query($conresult, "SELECT * FROM '' WHERE lgn_uname = '".$uname."' && lgn_pwd = '$pwd'");
$num_rows1 = mysqli_num_rows($result1);
if ($num_rows1 != 0) {
$row = mysqli_fetch_array($result1);
$_SESSION[cmsauth] = $row[lgnid];
$_SESSION[loginttype] = $row[lgn_typ];
$_SESSION[cmsvar] = "MNH2010ADMLG";
$_SESSION[lastlogin] = $row[lgn_lastupdt];
$result1 = mysqli_query($conresult, "update loan_login set lgn_lastupdt = NOW() where lgnid=" . $row[lgnid]);
mysqli_close($conresult);
$queryStmt = mysql_query("UNLOCK TABLES");
?>
<script>
</script>
<?php
} else {
$flag = "false";
//echo mysql_error();
}
} //flage ends
} //subflag ends
我同时回显$ conresult和$ result1,它们都为空?
有人可以帮我吗,mysqli_query如何在生产中工作,而空$ conresult却不能在产品中工作。
谢谢。