Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $user = $_POST['txtuser'];
- $PWD = $_POST ['txtpassword'];
- $con = mysqli_connect("localhost","root","");
- if (!$con)
- {
- die('Could not connect: ' . mysql_error());
- }
- mysqli_select_db($con,"account");
- $result = mysqli_query($con,"SELECT * from access WHERE username='$user' and password='$PWD'");
- $found = mysqli_num_rows($result);
- if ($found) {
- $_SESSION["accessed"] = 1;
- echo "<center><h1>access granted.</h1></center>";
- echo "<script> location.href='home.php';</script>";
- } else {
- $_SESSION["accessed"] = 0;
- echo "<center><h1>Unknown User.<a href='login.html'>Try Again?</a></h1></center>";
- die ("<center><h2>access denied</h2></center> ");
- }
- mysqli_close($con);
- ?>
- <br />
- <a href="SECUREAREA.php">
- <center>
- <h1>Proceed To secure area</h1>
- </center>
- </a>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement