Je travaille sur un système de connexion de base. J'ai utilisé beaucoup de sources et de nombreux endroits du code sont des extraits d'autres systèmes de connexion en ligne. Le problème est que je suis simplement et gracieusement obtenir une page complètement vierge lors de la saisie du nom d'utilisateur et mot de passe dans loginpage.html
et quand il redirige vers ce fichier, BLANK PAGE.Vérification Login.php - Page vierge?
<?php
error_reporting(E_ALL^E_NOTICE);
include 'connectingshit.php';
//Basically naming a session and starting one
session_name('litLogin');
//The cookie is going to live for 2 weeks
session_set_cookie_params(2*7*24*60*60);
//Now we actually start the session
session_start();
ob_start();
if($_SESSION['id'] && !isset($_COOKIE['RemainLoggedIn']) && !$_SESSION['rememberMe'])
{
// If you are logged in, but you don't have the cookie (browser restarts)
// and you have not checked the rememberMe checkbox:
$_SESSION = array();
session_destroy();
// Destroy the session
}
if(isset($_POST['submit']))
{
//I hope I know what I am doing, this is supposed to hold our errors.
$errors = array();
if(!$_POST['username'] || !$_POST['password'])
$errors[] = 'All the fields must be filled in buddyboy!';
if(!count($errors))
{
//Assigning the input form shit to the variables/strings or wtf they are
$tinkerbells_username = $_POST['username'];
$tinkerbells_password = $_POST['password'];
$_POST['rememberMe'] = (int)$_POST['rememberMe'];
// We remove all dangerous characters (!!!!) WTF? Escaping them "WOW"...
$tinkerbells_username = stripslashes($tinkerbells_username);
$tinkerbells_password = stripslashes($tinkerbells_password);
$tinkerbells_username = mysqli_real_escape_string($conn, $tinkerbells_username);
$tinkerbells_password = mysqli_real_escape_string($conn, $tinkerbells_password);
$row = mysqli_fetch_assoc('SELECT id, username, password FROM members WHERE username = "$niloquieroser_username" AND password = "$niloquieroser_password"');
//Does basically the username exist when $row lookes for it in the database
if(($row['username']) && ($niloquieroser_username == $tinkerbells_username && $niloquieroser_password == $tinkerbells_password))
{
//Now fortunately or unfortunatley if it did work and everything is fine
//We can continue.....
$_SESSION['username'] = $row['username'];
$_SESSION['id'] = $row['id'];
$_SESSION['rememberMe'] = $_POST['rememberMe'];
//We store some data in the session
setcookie('RemainLoggedIn',$_POST['rememberMe']);
//cookie gets created
}
else $errors[]=("Wrongs username or/and password!");
}
header("Location: success.html");
exit;
}
ob_end_flush();
?>
Alors, quelle est l'erreur? s'il vous plaît mentionner l'erreur afin que nous puissions savoir où chercher – behz4d
Pouvez-vous indenter votre code, s'il vous plaît? Merci! – Ryan
vérifier le fichier error_log – GBD