Exemple #1
0
<?
 //WEBSITE STARTUP
  include_once('class_login2.php');
  include('class_menu.php');

  $login = new login(0, 2);
  $login->main();
  
  $menu = new menu();
  
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
   <title>SV Nieuwerkerk | Beheer</title>
   
   <meta name="author" content="Rob Hoogland" />
   <meta name="copyright" content="&copy; 2010 jeugdschaken.nl" />
   <meta name="description" content="Welkom - mijn-2e-huis.nl" />
   <meta name="keywords" content="Share documents, School Project, information, file sharing" />
   <meta name="robots" content="index,nofollow" />
    
   <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />

   <link rel="stylesheet" type="text/css" href="style.css" />


</head>
Exemple #2
0
        }
        if (empty($pass)) {
            $errors[] = 'You forgot to enter your password.';
        } else {
            $p = mysqli_real_escape_string($dbc, trim($pass));
        }
        if (empty($errors)) {
            // If everything's OK.
            // Retrieve the user_id and first_name for that email/password combination:
            $q = "SELECT user_id, first_name FROM users WHERE email='{$e}' AND pass=SHA1('{$p}')";
            $r = @mysqli_query($dbc, $q);
            // Run the query.
            // Check the result:
            if (mysqli_num_rows($r) == 1) {
                // Fetch the record:
                $row = mysqli_fetch_array($r, MYSQLI_ASSOC);
                // Return true and the record:
                return array(true, $row);
            } else {
                // Not a match!
                $errors[] = 'The email address and password entered do not match those on file.';
            }
        }
        // End of empty($errors) IF.
        // Return false and the errors:
        return array(false, $errors);
    }
}
// End of class login.
login::main();