-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathalta_usuario.php
More file actions
executable file
·38 lines (34 loc) · 936 Bytes
/
alta_usuario.php
File metadata and controls
executable file
·38 lines (34 loc) · 936 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
<?php
include_once "lib/functions.php";
if(isset($_POST["email_signup"]) && isset($_POST["pass_signup"]))
{
//Con addslashes escapamos las comillas, la barra invertida y NUL (el byte NULL).
//$nombre = $_POST["nombre"];
//$apellidos = $_POST["apellidos"];
//$email = $_POST["email_signup"];
//$pass = $_POST["pass_signup"];
$nombre = addslashes($_POST["nombre"]);
$apellidos = addslashes($_POST["apellidos"]);
$email = addslashes($_POST["email_signup"]);
$password = addslashes($_POST["pass_signup"]);
$barrio_id = addslashes($_POST["barrio_id"]);
//Obtenemos la IP
if(!empty($_SERVER['HTTP_CLIENT_IP']))
{
$ip = $_SERVER['HTTP_CLIENT_IP'];
}
elseif(!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
{
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
else
{
$ip = $_SERVER['REMOTE_ADDR'];
}
alta($nombre, $apellidos, $email, $password, $ip, $barrio_id);
}
else
{
header('Location:index.php');
}
?>