Try something like this... Using sessions is better
$dominio = $GLOBALS['dominio']; //Var from the form
$password = $GLOBALS['password']; //Var from the form
//Hace la sesion si el login y password estan correctos
if (isset($dominio)) {
$sql = "select * from clientes where nombre_dominio='$dominio' and ";
$sql = $sql . "password='$password'";
$res = mysql_query($sql);
$n = mysql_num_rows($res);
//Si no existe dominio y/o password
if($n == 0) {
$error_login++;
//Existe dominio y password
} else {
$ses = mysql_fetch_object($res);
sesion_login($ses->clave_dominio);
//Segun el tipo de usuario abre aplicación clientes o administrador
if($id == 1) {
redirect_url("admin.php"

;
} else {
redirect_url("clientes.php"

;
}
}
}
Someone who has never served other is someone that has never lived...