Return to Snippet

Revision: 41788
at February 23, 2011 13:44 by nosmk


Initial Code
<?
$derror="";

if (rget("login")=="1")
{

	$usuario=trim(rpost("usuario"));

	$qlogin=query("select id_usuarioadmin, password from usuariosadmin where usuario='".trim(rpost("usuario"))."'");
	
	if (count($qlogin)-1==0)
	{
		$derror="ERROR: Usuario o Password incorrecto.";
		unset($_SESSION["u"]);
	}
	else
	{
		if (ver($qlogin, 0, "password")!=rpost("password"))
		{
			$derror="ERROR: Usuario o Password incorrecto.";
			unset($_SESSION["u"]);
		}
		else
		{
			$_SESSION["u"]=ver($qlogin, 0, "id_usuarioadmin");
		}
	}
	

}

if (admin())
	redirect ("inicio.php");


?>

Initial URL

                                

Initial Description

                                

Initial Title
PHP Login Redirect

Initial Tags
login, redirect, textmate

Initial Language
Other