Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ob_start();
- session_start();
- include('../includes/header.php');
- include('includes/class/class.login.php'); // Login
- include('includes/class/class.form.php');
- $Action = "index.php";
- $formLogin = new Form($Action, 'login','post','return CheckLogin();','');
- //when form is submitted
- if(isset($_POST["submit"])){
- //Set sticky data for the form from POST array
- $aFormData = $_POST;
- $formLogin->setStickyData($aFormData);
- //validate form data
- // $formLogin->checkNotEmpty("Username");
- // $formLogin->checkNotEmpty("Password");
- //Authenticate when form is valid
- if($formLogin->getValid() == true){
- //Intitialising
- $sLoginMessage = "";
- $userLogin = new Login();
- $bLoadSuccess = $userLogin->userLogin($_POST["Username"]);
- if($bLoadSuccess == true){
- //successful load
- if ($userLogin->getPassword() == md5($_POST["Password"])){
- //password is correct
- $_SESSION["id"] = $userLogin->getUserID();
- header("Location: adminarea.php");
- exit;
- }else{
- //password is incorrect
- $sLoginMessage = "Password is not correct";
- }
- }else{
- //unsuccessful load
- $sLoginMessage = "Login name does not exist";
- }
- }
- }
- $formLogin->openFieldset();
- $formLogin->makeInputBox("Username","Username","CheckInput(this.id);");
- $formLogin->makePasswordBox("Password","Password");
- $formLogin->makeSubmitButton("submit","Login");
- $formLogin->closeFieldset();
- ?>
- <section class="left">
- <h1 class="Heading">Login To Admin Area</h1>
- <p class="loginError"><?php echo $sLoginMessage ?></p>
- <?php echo $formLogin->getHTML(); ?>
- </section> <!-- Section Left End -->
- <section class="right">
- <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.
- Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
- It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
- </p>
- </section><!-- Section Right End -->
- <?php include('../includes/footer.php'); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement