PHP Login Redirect


/ Published in: Other
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?
  2. $derror="";
  3.  
  4. if (rget("login")=="1")
  5. {
  6.  
  7. $usuario=trim(rpost("usuario"));
  8.  
  9. $qlogin=query("select id_usuarioadmin, password from usuariosadmin where usuario='".trim(rpost("usuario"))."'");
  10.  
  11. if (count($qlogin)-1==0)
  12. {
  13. $derror="ERROR: Usuario o Password incorrecto.";
  14. unset($_SESSION["u"]);
  15. }
  16. else
  17. {
  18. if (ver($qlogin, 0, "password")!=rpost("password"))
  19. {
  20. $derror="ERROR: Usuario o Password incorrecto.";
  21. unset($_SESSION["u"]);
  22. }
  23. else
  24. {
  25. $_SESSION["u"]=ver($qlogin, 0, "id_usuarioadmin");
  26. }
  27. }
  28.  
  29.  
  30. }
  31.  
  32. if (admin())
  33. redirect ("inicio.php");
  34.  
  35.  
  36. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.