-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaccount.php
95 lines (78 loc) · 3.35 KB
/
account.php
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
<?php require_once('connect.php'); ?>
<!DOCTYPE html>
<html lang="it">
<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">
<title>Account</title>
<style>
label {
display: inline-block;
font-size: large;
}
* {
font-family: Arial, Helvetica, sans-serif;
}
form {
display: flex;
flex-direction: column;
text-align: start;
}
input {
padding: 10px;
margin-bottom: 20px;
font-size: 15px;
}
</style>
</head>
<body>
<?php include('header.php'); ?>
<?php if (!isset($_SESSION['id'])) : ?>
<div style="display: flex; justify-content:center;">
<fieldset style="min-width: 400px">
<legend>Accedi</legend>
<form action="login.php" method="POST">
<label for="username">Username:</label>
<input type="text" id="username" name="username" required>
<label for="password">Password:</label>
<input type="password" id="password" name="password" required>
<input type="submit" value="Login">
</form>
</fieldset>
<fieldset style="min-width: 400px">
<legend>Registrati</legend>
<form action="register.php" method="POST">
<label for="firstname">Nome:</label>
<input type="text" id="firstname" name="firstname" required>
<label for="lastname">Cognome:</label>
<input type="text" id="lastname" name="lastname" required>
<label for="username">Username:</label>
<input type="text" id="username" name="username" required>
<label for="email">Email:</label>
<input type="email" id="email" name="email" required>
<label for="password">Password:</label>
<input type="password" id="password" name="password" required>
<input type="submit" value="Registrati">
</form>
</fieldset>
</div>
<?php else : ?>
<div style="display: flex; justify-content:center;">
<fieldset style="min-width: 400px">
<legend>Profilo</legend>
<form action="register.php" method="POST">
<label for="firstname">Nome:</label>
<input type="text" id="firstname" name="firstname" value="<?php echo $_SESSION['nome'] ?>" required readonly>
<label for="lastname">Cognome:</label>
<input type="text" id="lastname" name="lastname" value="<?php echo $_SESSION['cognome'] ?>" required readonly>
<label for="username">Username:</label>
<input type="text" id="username" name="username" value="<?php echo $_SESSION['username'] ?>" required readonly>
<label for="email">Email:</label>
<input type="email" id="email" name="email" value="<?php echo $_SESSION['email'] ?>" required readonly>
</form>
</fieldset>
</div>
<?php endif; ?>
</body>
</html>