Guest User

Untitled

a guest
Jun 13th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. <?php
  2. // Formularz
  3. if(isset($_POST['submitted']))
  4. {
  5. // Prepare
  6. $query = $db->prepare('INSERT INTO user (username, email, haslo) VALUES (:username, :email, :haslo)');
  7.  
  8. // Bind
  9. $query->bindValue(':username', htmlspecialchars($_POST['username']), PDO::PARAM_STR);
  10. $query->bindValue(':email', htmlspecialchars($_POST['email']), PDO::PARAM_STR);
  11. $query->bindValue(':haslo', htmlspecialchars($_POST['haslo']), PDO::PARAM_STR);
  12.  
  13. // Exec
  14. $query->execute();
  15.  
  16. // Print
  17. echo 'Zostałeś zarejestrowany!';
  18. }
  19.  
  20.  
  21.  
  22. // Przypisanie
  23. $tpl->assign('user', $user);
  24.  
  25. // Parse
  26. $tpl->parse('register_show.tpl');
Add Comment
Please, Sign In to add comment