-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinput.php
57 lines (45 loc) · 1.64 KB
/
input.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
setcookie('rqAlamat', $_POST['rdAlamat'], time() + 86400);
setcookie('ipkDef', $_POST['txtIPK'], time() + 86400);
setcookie('fontSize', $_POST['txtFont'], time() + 86400);
setcookie('fontWeight', $_POST['jenisFont'], time() + 86400);
setcookie('showAlamat', $_POST['rdTmplAlamat'], time() + 86400);
setcookie('showIpk', $_POST['rdTmplIPK'], time() + 86400);
$defaultRdAlamat = isset($_COOKIE['rqAlamat']) ? $_COOKIE['rqAlamat'] : "";
$defaultTxtIpk = isset($_COOKIE['ipkDef']) ? $_COOKIE['ipkDef'] : "";
if (!isset($_COOKIE['rqAlamat']) || !isset($_COOKIE['ipkDef'])) {
header("location:settings.php");
}
?>
<!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">
<title>Input</title>
</head>
<body>
<h1>Input student identity</h1>
<p>Input your identity :</p>
<form action="display.php" method="post">
<!-- nrp input -->
<p>NRP : </p>
<input type="text" name="student[]" required value="">
<!-- nama input -->
<p>Name : </p>
<input type="text" name="student[]" required value="">
<!-- alamat input -->
<p>Adress : </p>
<textarea name="student[]" cols="30" rows="10"
<?php if ($defaultRdAlamat == 'Ya') echo "required" ?>></textarea>
<!-- ipk input -->
<p>IPK : </p>
<input type="text" name="student[]" required value="<?php echo $defaultTxtIpk ?>">
<!-- button submit -->
<br>
<br>
<input type="submit" value="Submit" name="submit">
</form>
</body>
</html>