Advertisement
Guest User

Untitled

a guest
May 9th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.82 KB | None | 0 0
  1. <?php
  2.  
  3. error_reporting(E_ALL);
  4. ini_set('display_errors', '1');
  5.  
  6. require_once ('DBBase.php');
  7.  
  8. $code = $_GET["code"];
  9. echo $code;
  10.  
  11. $inputusername = "pedro";
  12. $inputpassword = "homo";
  13.  
  14. function updateCode() {
  15.     $DB = new DBConn();
  16.     $DB->update("users","userstate","'1'","username=" . $this->username);
  17.     echo "koodi vaihdettu";
  18. }
  19.  
  20. function checkVerification() {
  21.    
  22.     $asd = new DBConn();
  23.     $result = $asd->select("username,password", "users", "userstate=" . $this->code);
  24.     while ($row = mysqli_fetch_object($result)) {
  25.         $username = $row->username;
  26.         $password = $row->password;
  27.         echo $username;
  28.         echo $password;
  29.     }
  30.  
  31.     if ($inputpassword == $password) && ($inputusername == $username) {
  32.         updateCode();  
  33.     }
  34.  
  35.     else {
  36.  
  37.         echo "Väärä käyttäjätunnus ja/tai salasana";
  38.  
  39.     }
  40.  
  41. }
  42.  
  43. checkVerification();
  44.  
  45. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement