Exemplo n.º 1
0
session_start();
include dirname(dirname(dirname(__FILE__))) . "/functions/inc/util.inc.php";
include dirname(dirname(dirname(__FILE__))) . "/functions/inc/mydb.inc.php";
include dirname(dirname(dirname(__FILE__))) . "/functions/inc/seguridad.php";
include dirname(dirname(dirname(__FILE__))) . "/functions/conf/conf.php";
$conf = new conf();
$db = new mydb();
$db->rawData("SET NAMES 'utf8'");
$formatos_img = array('image/jpeg', 'image/pjpeg', 'image/png', 'image/jpg');
$_SESSION["campos"] = $_POST;
if (trim($_POST["nombre"]) != "" && trim($_POST["apellido"]) != "" && $_POST["estado"] != 0 && trim($_POST["email"]) != "" && trim($_POST["password"]) != "") {
    if (!validarMail($_POST["email"])) {
        header("Location:../index.php?acc=" . $_POST["acc"] . "&msg=8");
        die;
    }
    if (!validarPass($_POST["password"])) {
        header("Location:../index.php?acc=" . $_POST["acc"] . "&msg=9");
        die;
    }
    $existe_mail = $db->consulta("SELECT * FROM usuario_sitio WHERE usw_eliminado=0 AND usw_email='" . $_POST["email"] . "'");
    if (count($existe_mail)) {
        header("Location:../index.php?acc=" . $_POST["acc"] . "&msg=6");
        die;
    }
    if (trim($_POST["scanycar"]) != "") {
        $existe_scanycar = $db->consulta("SELECT * FROM usuario_sitio WHERE usw_eliminado=0 AND usw_scanycar='" . trim(addslashes($_POST["scanycar"])) . "'");
        if (count($existe_scanycar)) {
            header("Location:../index.php?acc=" . $_POST["acc"] . "&msg=7");
            die;
        }
    }
Exemplo n.º 2
0
session_start();
include dirname(dirname(dirname(__FILE__))) . "/functions/inc/util.inc.php";
include dirname(dirname(dirname(__FILE__))) . "/functions/inc/mydb.inc.php";
include dirname(dirname(dirname(__FILE__))) . "/functions/inc/seguridad.php";
include dirname(dirname(dirname(__FILE__))) . "/functions/conf/conf.php";
$conf = new conf();
$db = new mydb();
$db->rawData("SET NAMES 'utf8'");
$formatos_img = array('image/jpeg', 'image/pjpeg', 'image/png', 'image/jpg');
if (trim($_POST["nombre"]) != "" && trim($_POST["apellido"]) != "" && $_POST["estado"] != 0 && trim($_POST["email"]) != "") {
    if (!validarMail($_POST["email"])) {
        header("Location:../index.php?acc=" . $_POST["acc"] . "&msg=8&id=" . $_POST["id"]);
        die;
    }
    if (!validarPass($_POST["password"]) && $_POST["password"] != "") {
        header("Location:../index.php?acc=" . $_POST["acc"] . "&msg=9&id=" . $_POST["id"]);
        die;
    }
    $existe_mail = $db->consulta("SELECT * FROM usuario_sitio WHERE usw_eliminado=0 AND usw_id!=" . $_POST["id"] . " AND usw_email='" . $_POST["email"] . "'");
    if (count($existe_mail)) {
        header("Location:../index.php?acc=" . $_POST["acc"] . "&msg=6&id=" . $_POST["id"]);
        die;
    }
    if (trim($_POST["scanycar"]) != "") {
        $existe_scanycar = $db->consulta("SELECT * FROM usuario_sitio WHERE usw_eliminado=0 AND usw_id!=" . $_POST["id"] . " AND usw_scanycar='" . trim(addslashes($_POST["scanycar"])) . "'");
        if (count($existe_scanycar)) {
            header("Location:../index.php?acc=" . $_POST["acc"] . "&msg=7&id=" . $_POST["id"]);
            die;
        }
    }
Exemplo n.º 3
0
    $msjError = $msjError . "Debe ingresar el segundo password <br/>";
}
if ($nombre == '') {
    $msjError = $msjError . "Debe ingresar nombre <br/>";
}
if ($apellido == '') {
    $msjError = $msjError . "Debe ingresar apellido <br/>";
}
if ($documento == '') {
    $msjError = $msjError . "Debe ingresar documento <br/>";
}
//valido psw
if (!validarPass($psw, $psw2)) {
    $msjError = $msjError . "Deben coincidir los passwords <br/>";
}
if (validarPass($psw, $psw2) && strlen($psw) < 4) {
    $msjError = $msjError . "El password debe tener mas de 4 caracteres. <br/>";
}
//validar edad
if (!is_numeric($edad)) {
    $msjError = $msjError . "La edad debe ser numerica <br/>";
}
if (!is_numeric($documento)) {
    $msjError = $msjError . "El documento debe ser numerico. <br/>";
}
//echo $msjError;
function validarPass($pass1, $pass2)
{
    return $pass1 == $pass2;
}
function pre($arg1, $tipo = 1)