$pagina_actual = "inicio"; $categoria_actual = "inicio"; require_once("../panel/includes/config.php"); require_once("../panel/includes/funciones.php"); use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; require '../PHPMailer-master/src/Exception.php'; require '../PHPMailer-master/src/PHPMailer.php'; require '../PHPMailer-master/src/SMTP.php'; $google_recaptcha["clave"] = $json_datos_panel["clave_recaptcha"]; $google_recaptcha["secret"] = $json_datos_panel["secret_recaptcha"]; if (isset($_POST["email"])) { //VALIDACION RECAPTCHA if (isset($_POST["token"])) { define("RECAPTCHA_V3_SECRET_KEY", $google_recaptcha["secret"]); $token = $_POST['token']; $action = $_POST['action']; extract($_POST, EXTR_SKIP); // call curl to POST request $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://www.google.com/recaptcha/api/siteverify"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array('secret' => RECAPTCHA_V3_SECRET_KEY, 'response' => $token))); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $arrResponse = json_decode($response, true); if ($arrResponse["success"] == '1' && $arrResponse["action"] == $action && $arrResponse["score"] >= 0.5) { //FIN VALIDACION RECAPTCHA $existe_email = $mysqli->query(" SELECT id, nombre, email FROM usuario_web WHERE email='" . $email . "' "); if ($existe_email->num_rows > 0) { header('Location: registro.php?error=Este email ya se encuentra registrado'); } else { $result = $mysqli->query(" INSERT INTO usuario_web (nombre, email, clave, hash) VALUES ( '" . decodificar($nombre) . "', '" . decodificar($email) . "', '" . hashPassword($password) . "', '" . time() . "' ) "); $id = $mysqli->insert_id; $titulo = 'Registro en ' . $nombre_empresa; $url_activar = '' . $url_instalacion . 'suscripcion/registro-confirmacion.php?id=' . $id . '&t=' . time(); $mensaje = '
Gracias por tu registro, para finalizar con el mismo por favor verifica tu cuenta realizando clic en el siguiente botón
Si no puede ver el botón copie y pegue el siguiente enlace en su navegador:
' . $url_activar . '
Gracias por elegir nuestros servicios
El equipo de ' . $nombre_empresa . '
Completá tus datos y activá tu cuenta.