-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtambahkan.php
61 lines (54 loc) · 1.58 KB
/
tambahkan.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
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$username = $_POST["username"];
$password = $_POST["password"];
$nohp = $_POST["nohp"];
$user_file = "user.txt";
// Format data pengguna yang akan disimpan
$user_data = "$username,$password,$nohp" . PHP_EOL;
// Menyimpan data pengguna ke file user.txt
file_put_contents($user_file, $user_data, FILE_APPEND | LOCK_EX);
// Redirect ke halaman login
header("Location: login.php");
exit();
}
?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Animated Sign Up Form | CodingNepal</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="center">
<h1>Sign Up</h1>
<form method="post">
<div class="txt_field">
<input type="text" name="full_name" required>
<span></span>
<label>Full Name</label>
</div>
<div class="txt_field">
<input type="text" name="username" required>
<span></span>
<label>Username</label>
</div>
<div class="txt_field">
<input type="password" name="password" required>
<span></span>
<label>Password</label>
</div>
<div class="txt_field">
<input type="nohp" name="nohp" required>
<span></span>
<label>No Handphone</label>
</div>
<input type="submit" value="Sign Up">
<div class="signup_link">
Already a member? <a href="login.php">Login</a>
</div>
</form>
</div>
</body>
</html>