Advertisement
Guest User

Untitled

a guest
Jul 1st, 2017
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.45 KB | None | 0 0
  1. <?php
  2. /*=========================
  3.     Simple Login System
  4. ===========================
  5.     Made by Winterpartys
  6. ===========================*/
  7. // Daniel Starnes Edit: 26/11/2010 approximately 7:42 PM.
  8.  
  9. session_start();
  10. include "config.php"; //This contains the $row shizzle
  11.  
  12. //Defines the users input when logging in.
  13. $username = $_POST["user"];
  14. $password = sha1($_POST["pass"]);
  15.  
  16. //Defines the users input and uses it from the db.
  17. $dbusername = $row["name"];
  18. $dbpassword = $row["pass"];
  19.  
  20. // Check to see if they match
  21. if ($username==$dbusername&&$password==$dbpassword){
  22.     $add_coins = $row['coins'] + 3;
  23.     mysql_query("UPDATE members SET coins = '$add_coins' WHERE name = '$username'");
  24.         echo "<font face='Tahoma' size='2'>Thank you for signing in <b>$username</b>!<br>
  25.        Another 3 coins have been added when logging in!
  26.        <ul>
  27.        <li><a href='index.php'>Procced..</a></li>
  28.    </ul></font>";
  29.         $_SESSION['username']=$username;
  30.         } else {
  31.  
  32.         echo "<font face='Tahoma' size='2'>The password you entered is incorrect. <br><a href='index.php'>Go Back</a>.</font>";
  33. } else {
  34.         echo "<font face='Tahoma' size='2'>The user that you specified does not exist. You may register this account by clicking <a href='register.php'>here</a>.</font>";
  35. } else {
  36.         echo "<font face='Tahoma' size='2'>You must be logged in to view this page. To log in, please click <a href='index.php'>here</a>.</font>";
  37. }
  38. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement