-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathregistration.php.bak
86 lines (76 loc) · 2.71 KB
/
registration.php.bak
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
<?php
include("admin/cookie.php");
include("database.php");
include("front_head.php");
include("front_menu.php");
?>
<div class="cont">
<div class="containForm registration">
<div class="form">
<?php
$name = "";
$surname = "";
$email = "";
$password = "";
$indirizzo = "";
if(isset($_POST['name'])) {$name = $_POST['name'];}
if(isset($_POST['surname'])) {$surname = $_POST['surname'];}
if(isset($_POST['email'])) {$email = $_POST['email'];}
if(isset($_POST['password'])) {$password = $_POST['password'];}
if(isset($_POST['indirizzo'])) {$indirizzo = $_POST['indirizzo'];}
?>
<span class="title">Registrazione</span>
<form id="reg_form" action="registration.php" method="POST">
<div class="input-field">
<input name="name" type="text" placeholder="Inserisci il tuo nome" required>
<i class="uil uil-user"></i>
</div>
<div class="input-field">
<input name="surname" type="text" placeholder="Inserisci il tuo Cognome" required>
<i class="uil uil-user"></i>
</div>
<div class="input-field">
<input name="indirizzo" type="text" placeholder="via Letizia sfdfia, 12 - 80100, Cosenza (CS)" required>
<i class="uil uil-map-marker-shield"></i>
</div>
<div class="input-field">
<input name="email" type="text" placeholder="Inserisci la tua email" required>
<i class="uil uil-envelope"></i>
</div>
<div class="input-field">
<input name="password" class="password" type="password" placeholder="Inserisci la tua password" required>
<i class="uil uil-lock icon"></i>
<i class="uil uil-eye-slash showHidePw"></i>
</div>
<div class="input-field button">
<input type="submit" value="Registrati">
</div>
</form>
<div class="login_signup">Sei già registrato?
<span>
<a href="log_in.php" class="text signup_text log_link">Accedi</a>
</span>
</div>
<span class="form_succes">
<?php
$query = "INSERT INTO utenti (nome, cognome, email, password, indirizzo, ruolo) VALUES ('$name','$surname',
'$email', md5('$password'), '$indirizzo', 'user')";
if($_SERVER['REQUEST_METHOD'] === 'POST') {
if($con->query($query) == true) {
echo "Registrazione avvenuta con successo";?>
<script>
let tID = setTimeout(function() {
window.location.href = "log_in.php"
window.clearTimeout(tID)
},2200)
</script><?php
}else{
echo "Errore di connessione al server: " . $con->error;
}
}
?>
</span>
</div>
</div>
</div>
<?php include("front_footer.php"); ?>