Advertisement
Guest User

Untitled

a guest
Apr 5th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. <?php
  2.  
  3. if(isset($_POST['username']) && isset($_POST['password']))
  4. {
  5.  
  6. $username = $_POST['username'];
  7. $password = $_POST['password'];
  8.  
  9. $dbhost = 'localhost';
  10. $dbname = 'storify';
  11. $dbuser = 'root';
  12. $dbpass = '';
  13.  
  14. $pdo_info = "mysql:host=$dbhost;dbname=$dbname";
  15. $conn = new PDO($pdo_info, $dbuser, $dbpass);
  16.  
  17. $check = $conn->prepare("INSERT INTO users (Username, Password) VALUES (?,?)");
  18. $check->bindParam(1, $username);
  19. $check->bindParam(2, $password);
  20. $check->execute();
  21.  
  22. echo " paswword: " + $password;
  23. }
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement