Attenzione, sei gia loggato!
'; echo "

Cosa vuoi fare?


"; echo "Torna indietroalla pagina di prima."; include('footer.php'); exit(); } // Has an error message been passed to login.php? $error = $_GET['e']; if($error == 1) { $error = '
Attention! You must be logged in to view this page.
'; } // Only process if the login form has been submitted. if(isset($_POST['login'])) { $username = $_POST['username']; $password = $_POST['password']; // Check that the user is calling the page from the login form and not accessing it directly // and redirect back to the login form if necessary if (!isset($username) || !isset($password)) { header( "Location: home.php" ); exit(); } // Check that the form fields are not empty, and redirect back to the login page if they are elseif (empty($username) || empty($password)) { header( "Location: home.php" ); exit(); } else { //Convert the field values to simple variables // Add slashes to the username and md5() the password $user = addslashes($_POST['username']); $pass = md5($_POST['password']); $sql = "SELECT * FROM login_users WHERE username='$user' AND password='$pass'"; $result = mysql_query($sql); // Check that at least one row was returned $rowCheck = mysql_num_rows($result); if($rowCheck > 0) { while($row = mysql_fetch_array($result)) { // Start the session and register a variable session_start(); session_register('username'); // Successful login code will go here... header( "Location: ".$ref); exit(); } } else { // If nothing is returned by the query, unsuccessful login code goes here... $error = '
Nome o password errati.
'; } } } if(stristr($_SERVER['PHP_SELF'], 'admin')) { include('../header.php'); } else { include('header.php'); } echo $error; ?>

Login



Non sei ancora registrato? Cosa aspetti? Cliccaqui