Advertisement
Guest User

Untitled

a guest
Aug 14th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. <?php
  2. 2 session_name("smiljoiddz7");
  3. 3 session_start();
  4. 4 require_once('smarty3/Smarty.class.php');
  5. 5 require_once('smarty3/SmartyValidate.class.php');
  6. 6 require_once('database.inc.php');
  7. 7 $smarty =& new Smarty();
  8. 8 $dbconn = new sqlInterface();
  9. 9 if(empty($_POST)){
  10. 10 SmartyValidate::connect($smarty, true);
  11. 11 //SmartyValidate::register_validator('usernameLen', 'username:1:20', 'isLength');
  12. 12 //SmartyValidate::register_validator('passwordLen', 'password:4,20', 'isLength');
  13. 13 //SmartyValidate::register_validator('passwordEq', 'password:confirm', 'isEqual');
  14. 14 //SmartyValidate::register_validator('emailValid', 'email', 'isEmail');
  15. 15 $smarty->display('register.tpl');
  16. 16 }else{
  17. 17 SmartyValidate::connect($smarty);
  18. 18 var_dump(SmartyValidate::is_valid($_POST));
  19. 19 var_dump($_POST);
  20. 20 if(SmartyValidate::is_valid($_POST)){
  21. 21 SmartyValidate::disconnect();
  22. 22 $dbconn->addUser($_POST['username'], $_POST['password'], $_POST['email']);
  23. 23 $smarty->display('success.tpl');
  24. 24 }else{
  25. 25 $smarty->assign('polje', $_POST);
  26. 26 $smarty->display('register.tpl');
  27. 27 }
  28. 28 }
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement