if ($_REQUEST['myusername']!="" and $_REQUEST['mypassword']!="") { require('conect.php'); $link=conect(); $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $table = "users"; $consult = "select type from $tabla where idusuario='$myusername' and clave='$mypassword'"; $result=mysql_query($consult); $numreg=mysql_num_rows($result); if($numreg!=0) { $_REQUEST['type']=mysql_result($result,$i); if ($_REQUEST['type']=='1') { $_SESSION["valid"]= "y"; header("location:menuadmin.php"); } else { $_SESSION["valid"]= "y"; header("location:comentario.php"); } } else { echo "Login o password incorrect."; header("refresh:1;url=index.php"); } } else { echo "Login o password incorrect."; header("refresh:1;url=index.php"); } ?>
<?php session_start(); if($_SESSION["valid"]!="y"){ header("location:exit.php"); } ?> <html> <head> </head> <body> <a href="exit.php">CLose Session</a> </body> </html>
<? session_start(); session_destroy(); ?> <html> <head> </head> <body> <?php header("location:index.php"); ?> </body> </html>
unset($_SESSION['session_name']);
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)