-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathregistrarse.php
More file actions
114 lines (90 loc) · 3.99 KB
/
Copy pathregistrarse.php
File metadata and controls
114 lines (90 loc) · 3.99 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="navbar.css">
<link rel="stylesheet" href="info.css">
<link rel="stylesheet" href="form.css">
<title>Document</title>
<script>
var file;
function handleFiles(files){
file = files[0];
if(files[0].type=="image/jpeg"){
}
}
function chequeo(){
if(document.getElementsByName("name")[0].value=="")
window.location.href ="registrarse.php?error=No se insertó un nombre";
else if(document.getElementsByName("username")[0].value=="")
window.location.href ="registrarse.php?error=No se insertó un nombre de usuario";
else if(document.getElementsByName("email")[0].value=="")
window.location.href ="registrarse.php?error=No se insertó un email";
else if(document.getElementsByName("password")[0].value=="")
window.location.href ="registrarse.php?error=No se insertó una contraseña";
else if(document.getElementsByName("contrase")[0].value=="")
window.location.href ="registrarse.php?error=No se re insertó la contraseña";
else if(!document.getElementsByName("check")[0].checked)
window.location.href ="registrarse.php?error=Es necesario aceptar los Términos de uso y Política";
else if(document.getElementsByName("contraseña")[0].value!=document.getElementsByName("contrase")[0].value)
window.location.href ="registrarse.php?error=Contraseñas no coinciden";
else if(!file || file.type!="image/jpeg")
window.location.href ="registrarse.php?error=La imagen es inexistente o no es JPG";
else{
return true;
}
return false;
}
</script>
</head>
<?php
include 'assets/header/header.php';
?>
<p class="title">
Registrarse
</p>
<form class="form" action="controllers/users_controller.php" onsubmit="return chequeo()" method="POST" autocomplete="off" enctype="multipart/form-data">
<div>
<?php
if (array_key_exists("error", $_GET))
echo '<p style="color:red;">' .$_GET["error"]. '</p>';
?>
</div>
<div class="input-group">
<label for="name">Nombre: </label>
<input type="text" name="name" class="form-control">
</div>
<div class="input-group">
<label for="username">Usuario: </label>
<input type="text" name="username" class="form-control">
</div>
<div class="input-group">
<label for="email">Email: </label>
<input type="email" name="email" class="form-control">
</div>
<div class="input-group">
<label for="contraseña">Contraseña: </label>
<input type="password" name="password" class="form-control">
</div>
<div class="input-group">
<label for="contrase">Re-Ingresar Contraseña: </label>
<input type="password" name="contrase" class="form-control">
</div>
<div class="input-group">
<label for="photo">Foto(JPG):</label>
<input type="file" name="photo" id="photo" onchange="handleFiles(this.files)" accept=".jpg">
</div>
<div class="policy">
<input type="checkbox" name="check" >
<label for="check">Acepto los <a href="#">Terminos de uso</a> y <a href="#">Política de privacidad</a>. </label>
</div>
<input class="btn" type="submit" value="Registrarse">
</form>
<div class="info">
<p>Página creada por: Diego Eugenio Saldívar Narváez</p>
<p>Materia: Fundamentos Web</p>
</div>
</body>
</html>