Código PHP:
if(isset($_GET['action']) && $_GET['action']=="login" && isset($_GET['how']) && $_GET['how']=="asregistereduser"){
$passwd_in_db = md5($_POST['passwd']);
$query = "SELECT * FROM users WHERE login='".$_POST['login']."' AND password='".$passwd_in_db."' AND active<>0";
$result = mysql_query($query) or die("No se ha podido ejecutar la consulta ".$query.". MySQL ha dicho: ".mysql_error());
if($result){
CreateLogs("log","a",$query);
$source = mysql_fetch_assoc($result);
}else{
CreateLogs("err","a",$query);
header("Location: index.php?err=nouserselected");
}
if($source['login'] == $_POST['login'] && $source['password']==$passwd_in_db){
SessionStart($source['login'],$source['level']);
HeaderPage("5","index.php?user=".$_SESSION['nombre']."&".SID."");
}
}
Salu2