-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
89 lines (75 loc) · 2.24 KB
/
index.php
File metadata and controls
89 lines (75 loc) · 2.24 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
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
<?php
@include 'config.php';
$insert = false;
if(isset($_POST['name'])){
if(!$con){
die("connection to this database failed due to" . mysqli_connect_error());
}
$name = $_POST['name'];
$lastname = $_POST['lastname'];
$email = $_POST['email'];
$password = $_POST['password'];
$sql = "INSERT INTO data(`name`, `lastname`, `email`, `password`, `dt`) VALUES ( '$name', '$lastname', '$email', '$password', current_timestamp())";
if($con->query($sql) == true){
$insert = true;
header('location:./main/index.php');
}
else{
echo "ERROR: $sql <br> $con->error";
}
$con->close();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Sign Up</title>
<link rel="stylesheet" href="style.css" />
<link
href="https://fonts.googleapis.com/css2?family=Roboto:wght@300&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="preloader.css">
<script>
setTimeout(function(){
window.onload=function(){
document.getElementById('loader').style.display="none";
document.getElementById('content').style.display="block";
}
}, 50);
};
</script>
<style>
</style>
</head>
<body>
<div class="signup-box">
<h1>Sign Up</h1>
<h4>It's free and only takes a minute</h4>
<form action="index.php" method="post">
<label>First Name</label>
<input type="text" name="name" id="name" placeholder="" />
<label>Last Name</label>
<input type="text" name="lastname" id="lastname" placeholder="" />
<label>Email</label>
<input type="email" name="email" id="email" placeholder="" />
<label>Password</label>
<input type="password" name="password" id="password" placeholder="" />
<input type="submit" value="Submit" />
<closeform></closeform></form>
<p>
By clicking the Sign Up button,you agree to our <br />
<a href="#">Terms and Condition</a> and <a href="#">Policy Privacy</a>
</p>
</div>
<p class="para-2">
Already have an account? <a href="login.php">Login here</a>
</p>
<?php
if($insert == true){
echo "<p class='submitMsg'>Thanks for Creating your account</p>";
}
?>
</div>
</body>
</html>