-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathregistration.php
More file actions
39 lines (35 loc) · 1.28 KB
/
Copy pathregistration.php
File metadata and controls
39 lines (35 loc) · 1.28 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Registration</title>
<link rel="stylesheet" href="registeration/css/style.css" />
</head>
<body>
<?php
require('registeration/db.php');
// If form submitted, insert values into the database.
if (isset($_POST['username'])){
$username = $_POST['username'];
$email = $_POST['email'];
$password = $_POST['password'];
$trn_date = date("Y-m-d H:i:s");
$query = "INSERT into `users` (username, password, email, trn_date) VALUES ('$username','$password', '$email', '$trn_date')";
$result = mysql_query($query);
if($result){
echo "<div class='reg'><center><h3>You are registered successfully.</h3><br/>Click here to <a href='index.php'><h3>Login</h3></a></center></div>";
}
}else{
?>
<div class="form">
<center><h1 style="color:#78b941;">Registration</h1></center>
<form name="registration" action="" method="post">
<input type="text" name="username" placeholder="Username" required />
<input type="email" name="email" placeholder="Email" required />
<input type="password" name="password" placeholder="Password" required />
<input type="submit" name="submit" value="Register" />
</form>
</div>
<?php } ?>
</body>
</html>