Advertisement
Guest User

Untitled

a guest
Oct 13th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. <?
  2. session_start();
  3. $usuario_admin=isset($_SESSION['1x11'])?$_SESSION['1x11']:'';
  4.  
  5. include("conf.inc.php");
  6. include("conectar.php");
  7.  
  8. $query="select * from admin where username='".$_POST["name"]."' and pass='".$_POST["pass"]."'";
  9. $result=mysql_query($query,$db);
  10. $row=mysql_fetch_array($result);
  11. $total = mysql_num_rows($result);
  12. $name=$_POST['name'];
  13. $pass=$_POST['pass'];
  14. $ADMIN_USERNAME=$row["username"];
  15. $ADMIN_PASSWORD=$row["pass"];
  16.  
  17. if($total>0){
  18. if($name==$ADMIN_USERNAME && $pass==$ADMIN_PASSWORD){
  19. if($usuario_admin!='') $_SESSION['1x11']="";
  20. $_SESSION["1x11"] = $name;
  21. $_SESSION['logedin'] = true;
  22. $_SESSION["type"] = $row["type"];
  23. $_SESSION["usrname"] = $name;
  24. $_SESSION["logid"] = $row["id"];
  25. header("Location:index2.php");
  26. }
  27. } else {
  28. header("Location:index.php?id=1");
  29. }
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement