Advertisement
Guest User

Untitled

a guest
Jun 4th, 2017
508
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. function page_login($username,$password) {
  2.  
  3.  
  4.  
  5. $username1 = validate_username($username);
  6.  
  7. $password1 = validate_password($password);
  8.  
  9.  
  10.  
  11. if($username1 && $password1) {
  12.  
  13. if($username == 'qwizie' && $password =='password') $error = 'Successful';
  14.  
  15. else $error = 'not valid creditals';
  16.  
  17. }elseif($username1 && !$password1) {
  18.  
  19. $error = 'Error: We need a Password';
  20.  
  21. }elseif(!$username1 && $password1) {
  22.  
  23. $error = 'Error: We need a Username';
  24.  
  25. }else{
  26.  
  27. $error = 'no form submit';
  28.  
  29. }
  30.  
  31. $smarty = new Smarty;
  32.  
  33. $smarty->assign('error',$error);
  34.  
  35. $smarty->assign('title', SITE_NAME.' - Login');
  36.  
  37. $smarty->assign('static_url', STATIC_URL);
  38.  
  39. $smarty->assign('language', mylanguage('sv'));
  40.  
  41. $smarty->display('login.tpl');
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement