GIF89a php
Current File : /home/drbalajibabycent/public_html/Admin-Panel/index.php
<?php
   session_start();
 include 'db.php';
 
 
 
if(isset($_SESSION['name'])) {
  header('location: home.php'); 
  
 
}
if(isset($_POST["submit"])){
  include 'db.php';
  if(!empty($_POST['name']) && !empty($_POST['password'])){
    $user = $_POST['name'];
    $pass = $_POST['password'];
    //DB Connection
   
    //Selecting database
    $query = mysqli_query($db, "SELECT * FROM p30 WHERE name='".$user."' AND password='".$pass."'");
    $numrows = mysqli_num_rows($query);
    if($numrows !=0)
    {
      while($row = mysqli_fetch_assoc($query))
      {
        $dbusername=$row['name'];
        $dbpassword=$row['password'];

        $id=$row['id'];

      }
      if($user == $dbusername && $pass == $dbpassword)
      {
        session_start();
        $_SESSION['name']=$user;

       
       
       $_SESSION['id']=$id;
        //Redirect Browser
        header("Location:home.php");
      }
    }
    else
    {
      echo "Invalid Username or Password!";
    }
  }
  else
  {
    echo "Required All fields!";
  }
}
?>




<!DOCTYPE html>
<html lang="en">
    
<!-- Mirrored from thememinister.com/crm/login.html by HTTrack Website Copier/3.x [XR&CO'2014], Thu, 03 Oct 2019 15:43:24 GMT -->
<head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
        <title>Login Panel</title>

        <!-- Favicon and touch icons -->
        <link rel="shortcut icon" href="assets/dist/img/ico/favicon.png" type="image/x-icon">
        <!-- Bootstrap -->
        <link href="assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
        <!-- Bootstrap rtl -->
        <!--<link href="assets/bootstrap-rtl/bootstrap-rtl.min.css" rel="stylesheet" type="text/css"/>-->
        <!-- Pe-icon-7-stroke -->
        <link href="assets/pe-icon-7-stroke/css/pe-icon-7-stroke.css" rel="stylesheet" type="text/css"/>
        <!-- style css -->
        <link href="assets/dist/css/stylecrm.css" rel="stylesheet" type="text/css"/>
        <!-- Theme style rtl -->
        <!--<link href="assets/dist/css/stylecrm-rtl.css" rel="stylesheet" type="text/css"/>-->
    </head>
    <body>
        <!-- Content Wrapper -->
        <div class="login-wrapper">
            <!--<div class="back-link">
                <a href="index.html" class="btn btn-add">Back to Dashboard</a>
            </div>-->
            <div class="container-center">
            <div class="login-area">
                <div class="panel panel-bd panel-custom">
                    <div class="panel-heading">
                        <div class="view-header">
                            <div class="header-icon">
                                <i class="pe-7s-unlock"></i>
                            </div>
                            <div class="header-title">
                                <h3>Login</h3>
                                <small><strong>Please enter your credentials to login.</strong></small>
                            </div>
                        </div>
                    </div>
                    <div class="panel-body">
                       <form method="POST" action="" enctype="multipart/form-data">
                            <div class="form-group">
                                <label class="control-label" for="username">Username</label>
                                <input name="name" type="text" class="form-control" placeholder="Enter UserName" required autocomplete="off">
                                <span class="help-block small">Your unique username to app</span>
                            </div>
                            <div class="form-group">
                                <label class="control-label" for="password">Password</label>
                                <input name="password" type="password" class="form-control" placeholder="Enter Password" required autocomplete="off">
                                <span class="help-block small">Your strong password</span>
                            </div>
                            <div>
                                <button class="btn btn-add" type="submit" name="submit">Login</button>
                                <!--<a class="btn btn-warning" href="https://amuthanagency.org/Register.php" target="_blank">Register</a>-->
                            </div>
                        </form>
                        </div>
                        </div>
                </div>
            </div>
        </div>
        <!-- /.content-wrapper -->
        <!-- jQuery -->
        <script src="assets/plugins/jQuery/jquery-1.12.4.min.js" type="text/javascript"></script>
        <!-- bootstrap js -->
        <script src="assets/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    </body>

<!-- Mirrored from thememinister.com/crm/login.html by HTTrack Website Copier/3.x [XR&CO'2014], Thu, 03 Oct 2019 15:43:24 GMT -->
</html>