<?php
if(!empty($_POST["register-user"])) {
/* Form Required Field Validation */
foreach($_POST as $key=>$value) {
if(empty($_POST[$key])) {
$error_message = "Todos los datos son obligatorios. All Fields are required";
break;
}
}
/* Password Matching Validation */
if($_POST['password'] != $_POST['confirm_password']){
$error_message = 'Las claves deben ser iguales. Passwords should be same<br>';
}
/* Email Validation */
if(!isset($error_message)) {
if (!filter_var($_POST["EMAIL"], FILTER_VALIDATE_EMAIL)) {
$error_message = "El email no es vĂ¡lido. Invalid Email Address";
}
}
/* Validation to check if gender is selected */
if(!isset($error_message)) {
if(!isset($_POST["GENERO"])) {
$error_message = " Todos los datos son obligatorios. All Fields are required";
}
}
/* Validation to check if Terms and Conditions are accepted */
if(!isset($error_message)) {
if(!isset($_POST["terms"])) {
$error_message = "Debe aceptar las condiciones del registro";
}
}
if(!isset($error_message)) {
require_once("dbcontroller.php");
$db_handle = new DBController();
$query = "INSERT INTO registered_users (CI, password, NOMBRE, APELLIDO, GENERO, FECHA-NACIMIENTO, DIRECCION, CP, CIUDAD, PAIS, CELULARA, CELULARB, EMAIL) VALUES
('" . $_POST["CI"] . "' , '" . $_POST["password"] . "' , '" . $_POST["NOMBRE"] . "' , '" . $_POST["APELLIDO"] . "' , '" . $_POST["GENERO"] . "' , ['" . $_POST"FECHA-NACIMIENTO"] . "' , '" . $_POST["DIRECCION"] . "' , '" . $_POST["CP"] . "' , '" . $_POST["CIUDAD"] . "' , '" . $_POST["PAIS"] . "' , '" . $_POST["CELULARA"] . "' , '" . $_POST["CELULARB"] . "' , '" . $_POST["EMAIL"] . "')";
$result = $db_handle->insertQuery($query);
if(!empty($result)) {
$error_message = "";
$success_message = "Felicitaciones. Has completado el registro correctamente. Congratulations. You have registered successfully!";
unset($_POST);
} else {
$error_message = "No se completado el registro. Vuelve a intentarlo. Problem in registration. Try Again!";
}
}
}
?>
- Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.7
- Parse error: syntax error, unexpected '"FECHA-NACIMIENTO"' (T_CONSTANT_ENCAPSED_STRING) in /in/SVfod on line 40
Process exited with code 255.
preferences:
171.02 ms | 1395 KiB | 36 Q