Guest User

sadsadsad

a guest
Aug 13th, 2016
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. <?php
  2. try {
  3.  
  4. $db = new PDO("mysql:host=xoxo; dbname=xoxot", xoxo, "xoxo");
  5. }
  6. catch(PDOException $e)
  7. {
  8. die( "Can't connect to database. Error: " . $e->getMessage() );
  9. }
  10.  
  11. $User=$_REQUEST['usermail'];
  12. $Password=$_REQUEST['password'];
  13.  
  14. $conv=hash('whirlpool',$Password);
  15. $Pass2= strtoupper($conv);
  16.  
  17. foreach ($db->query('SELECT Password FROM Accounts WHERE Name='.$db->quote($User).'') as $row) {
  18. }
  19. if($Pass2!=$row['Password']) die("Error: Invalid User/Pass <br> <a href=\"ucp.html\">Home Page</a>");
  20.  
  21. else{
  22. session_start();
  23. $_SESSION["Name"] = $User;
  24. $_SESSION["Logged"] = "true";
  25. echo("Logged: ".$_SESSION["Logged"].".");
  26. echo("Name: ".$_SESSION["Name"].".");
  27. header("Location: panel.php");
  28.  
  29. }
  30.  
  31.  
  32. ?>
Add Comment
Please, Sign In to add comment