<?php

$mail = $_POST['email'];

$idUser = 0;
$etapa = 1;

if($mail > ''){
    $cnx = new PDO("mysql:host=localhost:3306;dbname=qpsec_SIGPROI","qpsec_usrSIGPROI", "MabeLuis2602");
        
    $res=$cnx->query("SELECT id FROM `users` WHERE email='$mail'");
    
    foreach ($res as $row){
        $idUser = $row['id'];
    }

    if($idUser != 0)
    {

        $sql= "Update users set etapaCuenta=$etapa where id=$idUser";
        $cnx->prepare($sql)->execute();  
    }
}

header("location: https://sigproi.qps.ec");

?>