Advertisement
Guest User

Untitled

a guest
May 16th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.02 KB | None | 0 0
  1. <?
  2. // PATH DECLARATION
  3. $path = PATH;
  4. // CREATE TPL
  5. $tpl = new Template;
  6. // LOAD TPL
  7. $tpl->load(TPL."/login.html");  
  8. //LOAD CLASS
  9. include_once("lib/User.class.php");
  10. include_once("lib/Message.class.php");
  11.  
  12. // GETTING INFO
  13. if($_POST["submit"])
  14. {
  15.     if(!empty($_POST["username"]) && !empty($_POST["password"]))
  16.     {
  17.         try
  18.         {
  19.             $user = new User();
  20.             $user->Username = $_POST["username"];
  21.             $user->Password = $_POST["password"];
  22.             $user->Login();
  23.             $feedback = "";
  24.         }
  25.         catch(Exception $e)
  26.         {
  27.             $error = $e->getMessage();         
  28.         }  
  29.     }
  30.     else
  31.     {
  32.         $error = "Vul alle velden in.";
  33.     }
  34. }
  35.  
  36. if(isset($error)){$login_message = feedbackHandler($feedback,$error);}
  37. $message = new Message();
  38. $messages = $message->countRows("totalInbox");
  39.  
  40. // REPLACE $VAR BY TPL #VAR#
  41. $tpl->replace("path",$path);
  42. $tpl->replace("messages",$messages);
  43. $tpl->replace("login_message",$login_message);
  44. $tpl->replace("username",$_SESSION["U"]);
  45. $tpl->replace("userID",$_SESSION["I"]);
  46.  
  47. $tpl->publish(); // PUBLISH TEMPLATE
  48. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement