在图像上使用蒙版时,我得到了带有以下代码的白色背景:
if(isset($_POST['Login'])) {
try
{
// Run CSRF check, on POST data, in exception mode, for 10 minutes, in one-time mode.
NoCSRF::check( 'csrf_token', $_POST, true, 60*10, false );
$gump = new GUMP();
$_POST = $gump->sanitize($_POST); // You don't have to sanitize, but it's safest to do so.
$is_valid = GUMP::is_valid($_POST, array(
'entry' => 'required',
'password' => 'required'
));
if($is_valid === true) {
login($db , $_POST['entry'] ,$_POST['password'] );
}else{
$_SESSION['Error'] = $is_valid; // set error messages
header("location:".$_SERVER['PHP_SELF']); // redirect to php self
exit;
}
}
catch ( Exception $e )
{
// CSRF attack detected
$result[] = 'Session expired form ignored try again .'; //$e->getMessage() . ' Form ignored.';
$_SESSION['Error'] = $result; // set error messages
header("location:".$_SERVER['PHP_SELF']); // redirect to php self
exit;
}
}
function login($db , $entry , $password) {
//session_destroy();
$entry = (string)$entry;
$password = (string)$password;
/* $db->select($table , $columns , $where ) */
$datas = $db->select("user", [
"user_id",
"username",
"email"
], [
"AND"=>[
"OR" => [
"username" => "$entry",
"email" => "$entry"
],
"password"=>md5("$password"),
"status" => '1',
"verify_status" => '1',
]
]);
$error = $db->error(); // error
if(empty($error[2])) { // if error empty
if(is_array($datas) && count($datas) > 0) { // if select return result
extract($datas[0]);
$_SESSION['user_id'] = $user_id;
$_SESSION['user_name'] = $username;
$_SESSION['user_email'] = $email;
$_SESSION['user_is_logged'] = TRUE;
$_SESSION['Success'][] = "Successfully Logged In :)"; // set error messages
header("location:".BASE_URL); // redirect to php self
exit;
}else { // else invalid attempt
$_SESSION['Error'][] = "Invalid Credentials or you may not verified."; // set error messages
header("location:".$_SERVER['PHP_SELF']); // redirect to php self
exit;
}
}else {
$_SESSION['Error'][] = "Error on query.."; // set error messages
header("location:".$_SERVER['PHP_SELF']); // redirect to php self
exit;
}
}
我该如何在红色背景下使用面膜?