-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathregist.php
94 lines (72 loc) · 3.05 KB
/
regist.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
<?php
include 'config.php';
session_start();
if(isset($_SESSION['email'])){
header("Location: user2.php");
}elseif(isset($_SESSION['email']) == 'ara123@gmail.com'){
header("Location: index.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>Halaman Login</title>
<link rel="stylesheet" href="login.css">
</head>
<body style=" background-position: center; background-size: 114%; background-image: url(img/bglogintb.png)">
<div class="zan-login">
<div class="isi-login">
<div class="isi-left">
<img src="img/logohs.png" alt="">
<p>KONSUL BK</p>
</div>
<div class="dokicon">
<img src="img/logotb.png" alt="">
</div>
<p class="judul-login">REGISTER</p>
<form action="" method="post" enctype="multipart/form-data">
<div class="isi-right">
<label for=""><img src="img/nameicon.png" alt=""></label>
<input type="text" name="nama_user" placeholder="Full Name...">
<br>
<label for=""><img src="img/nameicon.png" alt=""></label>
<input type="text" name="email" placeholder="Email...">
<br>
<label for=""><img src="img/passicon.png" alt="" style="height: 25px;"></label>
<input type="password" name="password" placeholder="Password">
<br>
<input type="file" name="file">
<button type="submit" name="simpanakun" style=" margin-left: 23%; background-color: #083AA9; border: none; border-radius: 10px; color: white; width: 150px; height: 35px; font-weight: bold;">Sign Up</button>
<!-- dont have account -->
<br>
<div class="have-account">
<label for="">have account?</label>
<a href="login.php" style="color: green;">Sign In</a>
</div>
</div>
</form>
</div>
</div>
<?php
if(isset($_POST['simpanakun'])){
$pp = $_FILES['file']['name'];
$nama_user = $_POST['nama_user'];
$email = $_POST['email'];
$password = $_POST['password'];
$file_tmp = $_FILES['file']['tmp_name'];
if(move_uploaded_file($file_tmp, "img/$pp"));
$query = mysqli_query($connect, "INSERT INTO data_akun VALUES ('', '$pp', '$nama_user', '$email','$password','user')");
if($query){
header("Location: login.php");
}else{
header("Location: regist.php?status='gagal'");
}
// var_dump($file);
// die;
}
?>
</body>
</html>