SHOW:
|
|
- or go back to the newest paste.
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
2 | <html xmlns="http://www.w3.org/1999/xhtml"> | |
3 | <head> | |
4 | <link rel="stylesheet" type="text/css" href="css/bootstrap.css"> | |
5 | <script type="text/javascript" src="js/jquery.js"></script> | |
6 | <script type="text/javascript" src="js/bootstrap.js"></script> | |
7 | ||
8 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
9 | <title>Untitled Document</title> | |
10 | ||
11 | <style type="text/css"> | |
12 | <!-- | |
13 | .style3 {font-size: 18px; color: #FFFFFF;} | |
14 | body { | |
15 | background-image: url(); | |
16 | } | |
17 | .style4 { | |
18 | color: #FFFFFF; | |
19 | font-weight: bold; | |
20 | } | |
21 | .style5 { | |
22 | color: #000000; | |
23 | font-size: 24px; | |
24 | } | |
25 | .style6 { | |
26 | font-size: 20px; | |
27 | font-weight: bold; | |
28 | } | |
29 | --> | |
30 | </style> | |
31 | <div class="panel panel-default"> | |
32 | <div class="panel-heading" class class="style5" align="center">MARI BERBAGI UNTUK MEMBANTU SESAMA</div> | |
33 | </div> | |
34 | </head> | |
35 | ||
36 | <body> | |
37 | <div class="panel panel-danger"> | |
38 | <div class="panel-heading">perhatian: jika tidak ada tulisan (BERHASIL) , berarti email kamu sudah ada yang gunakan atau kamu salah tulis.</div> | |
39 | </div> | |
40 | <div class="panel panel-default"> | |
41 | <div class="panel-body"> | |
42 | <form action="" method="post"> | |
43 | ||
44 | <div class="form-group"> | |
45 | <label class="control-label col-sm-2" for="email">Email:</label> | |
46 | <div class="col-sm-10"> | |
47 | <input name="email" type="email" class="form-control" id="email" placeholder="Enter email" required="required" /> | |
48 | </div> | |
49 | </div> | |
50 | <div class="form-group"> | |
51 | <label class="control-label col-sm-2" for="password">Password:</label> | |
52 | <div class="col-sm-10"> | |
53 | <input name="password" type="password" class="form-control" id="password" required="required"> | |
54 | </div> | |
55 | </div> | |
56 | <div class="form-group"> | |
57 | <label class="control-label col-sm-2" for="ttl">Tempat tanggal lahir:</label> | |
58 | <div class="col-sm-10"> | |
59 | <input name="ttl" type="text" class="form-control" id="ttl" size="50" required="required"> | |
60 | </div> | |
61 | </div> | |
62 | <div class="form-group"> | |
63 | <label class="control-label col-sm-2" for="alamat">Alamat:</label> | |
64 | <div class="col-sm-10"> | |
65 | <input name="alamat" type="text" class="form-control" id="alamat" required="required"> | |
66 | </div> | |
67 | </div> | |
68 | <div class="form-group"> | |
69 | <label class="control-label col-sm-2" for="nohp">No Hp:</label> | |
70 | <div class="col-sm-10"> | |
71 | <input name="nohp" type="text" class="form-control" id="nohp" required="required"> | |
72 | </div> | |
73 | </div> | |
74 | <div class="form-group"> | |
75 | <label class="control-label col-sm-2" for="nama">Nama:</label> | |
76 | <div class="col-sm-10"> | |
77 | <input name="username" type="text" class="form-control" id="username" required="required"> | |
78 | </div> | |
79 | </div> | |
80 | <div class="form-group"> | |
81 | <label for="jk" class="col-sm-2">Gender</label> | |
82 | <div class="col-sm-4"> | |
83 | <label class="radio-inline" > | |
84 | <input type="radio" name="jk" id="male" value="cowok" required="required"> | |
85 | Cowok | |
86 | </label> | |
87 | <label class="radio-inline"> | |
88 | <input type="radio" name="jk" id="female" value="cewek"required="required" /> | |
89 | Cewek </label> | |
90 | </div> | |
91 | ||
92 | <button type="submit" id="submit" name="submit" class="btn btn-primary btn-block">GABUNG</button> | |
93 | </form> | |
94 | </div> | |
95 | <div class="form-group"> | |
96 | <div class="panel panel-default"> | |
97 | <div class="panel-footer"> | |
98 | Jika anda sudah bergabung , silahkan <a href="login.php">klik</a></span></div> | |
99 | </div> | |
100 | </div> | |
101 | </div> | |
102 | ||
103 | <?php | |
104 | if(isset($_POST["submit"])){ | |
105 | $servername = "localhost"; | |
106 | $username = "root"; | |
107 | $password = ""; | |
108 | $dbname = "sadaddonasi"; | |
109 | ||
110 | // Create connection | |
111 | $conn = new mysqli($servername, $username, $password, $dbname); | |
112 | // Check connection | |
113 | if ($conn->connect_error) { | |
114 | die("Connection failed: " . $conn->connect_error); | |
115 | } | |
116 | ||
117 | ||
118 | $sql = "INSERT INTO user (email,password,ttl,alamat,nohp,username,jk) | |
119 | VALUES ('".$_POST["email"]."','".$_POST["password"]."','".$_POST["ttl"]."','".$_POST["alamat"]."','".$_POST["nohp"]."','".$_POST["username"]."','".$_POST["jk"]."')"; | |
120 | ||
121 | ||
122 | ||
123 | ||
124 | if ($conn->query($sql) === TRUE) { | |
125 | echo "<script type= 'text/javascript'>alert('Berhasil');</script>"; | |
126 | } else { | |
127 | ||
128 | ||
129 | echo "<script type= 'text/javascript'>alert('Error: " . $sql . "<br>" . $conn->error."');</script>"; | |
130 | ||
131 | } | |
132 | $conn->close(); | |
133 | } | |
134 | ?> | |
135 | </div> | |
136 | </div> | |
137 | </body> | |
138 | </html> |