-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathregistro.php
More file actions
45 lines (35 loc) · 919 Bytes
/
registro.php
File metadata and controls
45 lines (35 loc) · 919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
// 0. Consigo los datos
$especialidad = $_POST['especialidad'];
$nombre = $_POST['nombre'];
$apellido = $_POST['apellido'];
$ciudad = $_POST['ciudad'];
$latitude = $_POST['latitude'];
$longitude = $_POST['longitude'];
$telefono = $_POST['telefono'];
$mail = $_POST['mail'];
// 1. Conectarme a la BD
include("conexion.php");
// 2. Crear la query
$insertar = "INSERT INTO registro
VALUES(
NULL,
'$especialidad',
'$nombre',
'$apellido',
'$ciudad',
'$latitude',
'$longitude',
'$telefono',
'$mail'
)";
// 3. Ejecutarla
$ej = mysqli_query($conexion, $insertar);
// 4. Preguntar si funcionó
if($ej === true){
header("location:index.php");
echo '<script>alert("¡Registrado con exito!");</script>';
} else {
echo "Error, ver SQL";
}
?>