Advertisement
Guest User

Untitled

a guest
Apr 8th, 2018
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.49 KB | None | 0 0
  1. <?php
  2. ini_set('display_errors', '1');
  3.  
  4. $user = 'cs108';
  5. $pass = '108';
  6.  
  7. $db = new PDO('mysql:host=localhost;dbname=cs108', $user, $pass);
  8. $db->query("SET NAMES utf8");
  9.  
  10. $descr  = $_POST['descr'];
  11. $user   = $_POST['user'];
  12. $pass   = $_POST['pass'];
  13. $note   = $_POST['note'];
  14. $addkey = $_POST['addkey'];
  15.  
  16. $sql_text = "INSERT INTO passwords (descr, user, pass, note, addkey) VALUES (?, ?, ?, ?, ?)";
  17. $st = $db->prepare($sql_text);
  18. $st->execute(array($descr, $user, $pass, $note, $addkey));
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement