Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $USER=$_POST['txtuser'];
- $PWD=$_POST['txtpassword'];
- $con = mysql_connect("localhost","root","");
- if(!$con)
- {
- die('Could not connect: '.mysql_error());
- }
- mysql_select_db("cs3a", $con);
- $result = mysql_query("SELECT * from access WHERE Username='$USER' and Password = '$PWD'");
- $found = mysql_num_rows($result);
- if($found){
- $_SESSION["accessed"] = 1;
- echo "<center><h1>access granted.</h1></center>";
- }
- else{
- $_SESSION["accessed"] = 0;
- echo "<center><h1> Unknown User. <a href = 'login.php'> Try again? </a> </h1> </center>";
- die("<center><h2>access denied.</h2></center>");
- }
- mysql_close($con);
- ?>
Add Comment
Please, Sign In to add comment