0byt3m1n1
Path:
C:
/
wamp64
/
www
/
WaterCat
/
[
Home
]
File: log2.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> </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="newsnew.php">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"> <input type="hidden" name="id"> <label>User Name : </label> <input type="text" placeholder="Enter Username" name="username" required> <br> <br> <label>Email : </label> <input type="email" id="email" name="email"> <br> <label>Password : </label> <input type="password" placeholder="Enter Password" name="password" required> <br> <br> <br> <br> <input type="submit" name="login" value="Login"> <p style="color: red"><i>If Not registered? <a href="reg.php">signup</a></i> <br> <a href="forgot.php">Forgot Password?</a> </p></div> </form> <?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']; $email=$_POST['email']; $query="select * from register where Name='$user' and Password='$pass'"; $result=mysqli_query($conn,$query); if(mysqli_fetch_assoc($result)) { $_SESSION['username']=$_POST['username']; $_SESSION['email']=$_POST['email']; header("location:welcome2.php?email=".$email); } else{ echo '<p align="center"><b><font color="red">' .$_SESSION['message'].'</font></b></p>'; unset($_SESSION['message']); } } } ?> <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>