0byt3m1n1
Path:
C:
/
wamp64
/
www
/
WaterCat
/
[
Home
]
File: adminlogin.php
<!doctype html> <html lang="en"> <head> <link rel="stylesheet" type="text/css" href="styles.css"> <link rel="stylesheet" type="text/css" href="nav.css"> <style> footer { background-color: #508ab3; /* Background color of the footer */ color: #fff; /* Text color */ padding: 20px 0; /* Padding around the footer content */ } .footer-content { display: flex; justify-content: space-between; align-items: flex-start; max-width: 1200px; /* Maximum width of the footer content */ margin: 0 auto; /* Center the footer content horizontally */ } .logo img { max-width: 100px; /* Adjust the maximum width of the logo */ height: auto; /* Maintain aspect ratio */ } .institution-name, .contact-info { flex: 1; padding: 0 20px; /* Spacing between elements */ } .contact-info h3, .institution-name h3 { margin-top: 0; /* Remove margin from the top of the headings */ } .copyright { text-align: center; /* Center the copyright text */ margin-top: 20px; /* Spacing between content and copyright */ } .copyright p { margin: 0; /* Remove margin from the paragraph */ } </style> <!-- Google tag (gtag.js) --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-MLKHL5MWPW"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-MLKHL5MWPW'); </script> </head> <body class="bg-white" background="assets/images/slider/s1.jpg" alt=""> <div class="topnav"> <a class="active" href="indexnew.php">Home</a> <a href="#news">News</a> <a href="contact.php">Contact</a> <a href="about.html">About</a> </div> <centre><h1>Login Form </h1> </centre> <?php if(@$_POST['Empty']==true) { ?> <div class="alert-light text-danger text-center my-3"> <?php } ?> <form method="POST" action="#"> <div class="container"> <label>User Name : </label> <input type="text" placeholder="Enter Username" name="username" required> <br> <br> <label>Password : </label> <input type="password" placeholder="Enter Password" name="password" required> <br> <br> <br> <br> <input type="submit" name="login" value="Login"> </div> <p>Forgot password? <a href="fadmin.php">Fogot password</a> </p> </form> <footer> <div class="footer-content"> <div class="logo"> <img class="footer-logo" alt src="assets/images/logooo.jpg"> </div> <div class="institution-name"> <h3>Centre for Water Resources Development and Management Kunnamangalam, </h3> <p>Kozhikode-673 571</p> <p>Kerala , India</p> </div> <div class="contact-info"> <h3>Contact Information</h3> <p>Email: ed@cwrdm.org</p> <p>Phone: (91) 495 2351800,2351801, 2351803, 2351804<br> Fax: (91) 495 2351808</p> </div> </div> <div class="copyright"> <p>© 2024 CWRDM. All rights reserved.</p> </div> </footer> </body> </html> </body> </html> <?php $servername="localhost"; $username="root"; $password=""; $dbname="watercat"; $conn=new mysqli($servername,$username,$password,$dbname); session_start(); $_SESSION['message']="Please Enter Correct Username and Password"; if(isset($_POST['login'])) { if(empty($_POST['username']) || empty($_POST['password'])) { header("location:login.php?Empty=Please fill the form"); } else { $user=$_POST['username']; $pass= $_POST['password']; $query="select * from admin where Username='$user' and Password='$pass'"; $result=mysqli_query($conn,$query); if(mysqli_fetch_assoc($result)) { $_SESSION['username']=$_POST['username']; $_SESSION['id']=$_POST['id']; header("location:welcomeadmin.php"); } else{ echo '<p align="center"><b><font color="red">' .$_SESSION['message'].'</font></b></p>'; unset($_SESSION['message']); } } } ?>