This repository has been archived by the owner on Aug 17, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create.php
97 lines (84 loc) · 3.03 KB
/
create.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
95
96
97
<?php
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<title>Create New Profile</title>
<link href="https://fonts.googleapis.com/css?family=Great+Vibes|Kaushan+Script|Quicksand" rel="stylesheet">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-rc.2/css/materialize.min.css">
<!-- Compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-rc.2/js/materialize.min.js"></script>
<link type="text/css" rel="stylesheet" href="css/css.css" media="screen,projection"/>
<script type="text/javascript" src="js/js.js"></script>
<style type="text/css">
h1,h2,h3,h4,h5,h6{
font-family: 'Kaushan Script', cursive;
}
p,a,li,ul,span,div{
font-family: 'Quicksand', sans-serif;
}
</style>
</head>
<body>
<!-- NAVBAR-->
<nav>
<div class="nav-wrapper white">
<a href="index.php" class="brand-logo right black-text" style="font-family: 'Great Vibes', cursive;">Writer's Den    </a>
</div>
</nav>
<!-- NAVBAR-->
<!--main material -->
<div class="container">
<h2>Create new Account</h2><br>
<form method="POST">
<div class="input-field col s3">
<i class="material-icons prefix">account_circle</i>
<input id="name" type="text" class="validate" name="name">
<label for="name">Name</label>
</div>
<div class="input-field col s3">
<i class="material-icons prefix">email</i>
<input id="email" type="email" class="validate" name="email">
<label for="email">Email</label>
</div>
<div class="input-field col s3">
<i class="material-icons prefix">phone</i>
<input id="Phone" type="tel" class="validate" name="phone">
<label for="Phone">Phone</label>
</div>
<div class="input-field col s3">
<i class="material-icons prefix">lock</i>
<input id="password" type="password" class="validate" name="password">
<label for="password">Password</label>
</div>
<button class="btn waves-effect waves-light" type="submit" name="submit">Submit
<i class="material-icons right">send</i>
</button>
</form>
</div>
</body>
</html>
<?php
if (isset($_POST['submit'])){
include_once 'connect.php';
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$password = $_POST['password'];
$sql = "INSERT INTO users (name, email, password, phone) VALUES ('$name','$email','$password','$phone');";
mysqli_query($con, $sql);
if (mysqli_affected_rows($con)>0) {
$_SESSION["msg"] = "set";
echo "<script>location.href='login.php';</script>";
}
else
{
echo "<h3> failed</h3>";
}
}
?>