-
Notifications
You must be signed in to change notification settings - Fork 0
/
account.php
66 lines (62 loc) · 2.81 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
<?php
session_start();
if (isset($_SESSION['username']))
header("Location: /");
$title = "Login";
if (isset($_GET['daftar']))
$title = "Daftar";
$cap1 = rand(1,9);
$cap2 = rand(1,9);
$_SESSION['captcha'] = $cap1 + $cap2
?>
<!DOCTYPE html>
<html lang="id">
<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="icon" type="image/x-icon" href="/static/favicon.png">
<title><?=$title?></title>
<link rel="stylesheet" href="/static/css/style.css"></link>
</head>
<body>
<div class="account">
<b><?=$title?> Akun</b>
<form>
<table>
<tr>
<td style="padding-right: 4px">Username</td>
<td><input type="text" placeholder="username" maxlength="20" class="form_data" name="username" value="<?=$_POST['username']?>"></td>
</tr>
<tr>
<td style="padding-right: 4px">Password</td>
<td><input type="password" placeholder="password" maxlength="36" class="form_data" name="password" value="<?=$_POST['password']?>"></td>
</tr>
<?php if (isset($_GET['daftar']) or isset($_POST['daftar'])) { ?>
<tr>
<td style="padding-right: 4px">Password</td>
<td><input type="password" placeholder="konfirmasi password" maxlength="36" class="form_data" name="cpassword" value="<?=$_POST['cpassword']?>"></td>
</tr>
<?php } ?>
<tr>
<td style="padding-right: 4px"><?=$cap1?> + <?=$cap2?></td>
<td><input type="number" placeholder="captcha" max="18" class="form_data" name="captcha"></td>
</tr>
<tr>
<td colspan="2" style="padding-top: 6px">
<?php if (isset($_GET['daftar']) or isset($_POST['daftar'])) { ?>
<button type="button" onclick="formButton('register')" id="register" name="daftar" class="btn btn-blue form_data">Daftar</button>
<button type="button" onclick="window.location.href='/account.php'" class="btn btn-green">Login Saja</button>
<?php } else { ?>
<button type="button" onclick="formButton('login')" id="login" name="login" class="btn btn-green form_data">Login</button>
<button type="button" onclick="window.location.href='/account.php?daftar'" class="btn btn-blue">Daftar Baru</button>
<?php } ?>
<button type="button" onclick="window.location.href='/'" class="btn btn-red">Kembali</button>
</td>
</tr>
</table>
</form>
</div>
<script type="text/javascript" src="/static/js/button.js"></script>
</body>
</html>