Advertisement
Guest User

Untitled

a guest
Jan 6th, 2012
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.81 KB | None | 0 0
  1. <?php
  2.  
  3. Include "Configuration.php";
  4.  
  5. If(LOGGED_IN) Header("Location: Index.php?alert=login_loggedin");
  6.  
  7. IPLog("Attempted to login.");
  8.  
  9. If(IsSet($_POST["username"]) && IsSet($_POST["password"])) {
  10.     If(UserExist(UserName2Id(Secure($_POST["username"])))) {
  11.         $User = MySQL_Query("SELECT * FROM `users` WHERE `username` = '".Secure($_POST["username"])."'");
  12.         $User = MySQL_Fetch_Array($User);
  13.         If(IsSet($User["password"])) {
  14.             If(Md5($_POST["password"]) == Md5($User["password"])) {
  15.                 $_SESSION["id"] = $User["id"];
  16.                 Header("Location: Index.php");
  17.             }Else{
  18.                 Header("Location: Index.php?alert=login_password");
  19.             }
  20.         }Else{
  21.             Header("Location: Index.php?alert=login_password");
  22.         }
  23.     }Else{
  24.         Header("Location: Index.php?alert=login_username");
  25.     }
  26. }Else{
  27.     Header("Location: Index.php");
  28. }
  29.  
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement