daily pastebin goal
62%
SHARE
TWEET

Untitled

a guest Sep 23rd, 2016 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.     require_once 'conf.php';
  3.     class users{
  4.         public $name;
  5.         public $pass;
  6.         function set_name_and_pass () {
  7.             $this->$name = htmlspecialchars($_POST['login']);
  8.             $this->$pass = htmlspecialchars($_POST['pass']);
  9.         }
  10.         function insert_new_user () {
  11.             $stmt = $pdo->prepare("INSERT INTO users (login,pass) VALUES (:log,:pass)");
  12.             $stmt->bindParam(':log',$name);
  13.             $stmt->bindParam(':pass',$pass);
  14.             $stmt-execute();
  15.         }
  16.     }
  17.     $user = new users;
  18.     $user->set_name_and_pass();
  19.     $user->insert_new_user();
  20. ?>
  21. <form action="" method="post">
  22.     <input type="text" name="login" required placeholder="login"><br>
  23.     <input type="password" name="pass" required placeholder="pass"><br>
  24.     <input type="submit" name="submit" value="ok">
  25. </form>
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