-
Notifications
You must be signed in to change notification settings - Fork 0
/
php.php
58 lines (57 loc) · 1.19 KB
/
php.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
<?php
//header('Content-Type: application/json; charset=utf-8');
if($_SERVER['REQUEST_METHOD'] === 'POST') {
$usr = $_POST['usr'];
$psw = $_POST['psw'];
$age = $_POST['age'];
echo "USERNAME: $usr PASSWORD: $psw AGE: $age";
} else {
$json = '[
{
"usr" : "guest PhP",
"psw" : "guest12345",
"age" : 25,
"role" : [
{
"role_utente" : "osptite",
"role_provvisorio" : "guest ospite"
}
]
},
{
"usr" : "user",
"psw" : "user12345",
"age" : 29,
"role" : [
{
"role_utente" : "utente",
"role_provvisorio" : "user ospite"
}
]
},
{
"usr" : "admin",
"psw" : "admin12345",
"age" : 33,
"role" : [
{
"role_utente" : "amministratore",
"role_provvisorio" : "admin ospite"
}
]
},
{
"usr" : "superadmin",
"psw" : "superadmin12345",
"age" : 55,
"role" : [
{
"role_utente" : "superman",
"role_provvisorio" : "superadmin ospite"
}
]
}
]';
echo $json;
}
?>