SHARE
TWEET

Untitled

a guest May 22nd, 2017 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $dbhost = "localhost";
  3. $dbname = "pg20011_tires";
  4. $dbuser = "pg20011_admin";
  5. $dbpass = "tires@2010";
  6.  
  7. mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error());
  8. mysql_select_db($dbname) or die(mysql_error());
  9.  
  10. $username = $_POST['username'];
  11. $password = $_POST['password'];
  12.  
  13. $query = "select * from users where username='$username' and password='$password'";
  14.  
  15. $result = mysql_query($query);
  16.  
  17. if (mysql_numrows($result) != 1) {
  18. $error = "Bad Login";
  19.     header("Location: website.php?page=login_fail");
  20. } else {
  21.     $_SESSION['username'] = $username;
  22.     include 'loginsucess.php';
  23. }
  24. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top