This repository has been archived by the owner on Nov 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
signup.php
78 lines (64 loc) · 2.79 KB
/
signup.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
<?php
require_once("config/init.php");
require_once("config/connect.php");
require_once("config/dbqueries.php");
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
$fullName = trim($_POST['fullname']);
$username = trim($_POST['username']);
$password = md5( trim($_POST['password']));
if(registreUser($fullName,$username,$password,$conn))
{
$userCheck = checkAuth($username,$password,$conn);
$_SESSION['user'] = $userCheck;
header('location: http://localhost/phpscript/');
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Qanswer Signup</title>
<link href="https://fonts.googleapis.com/css?family=Berkshire+Swash" rel="stylesheet">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/login.css">
</head>
<body>
<section id="login">
<div class="container">
<div class="row">
<div class="col-xs-12">
<div class="form-wrap">
<h1 class="logo">QAnswer</h1>
<form role="form" action="signup.php" method="post" id="login-form" autocomplete="off">
<div class="form-group">
<label for="full-name" class="sr-only">FUll Name</label>
<input type="text" required name="fullname" id="full-name" class="form-control" placeholder="Full Name">
</div>
<div class="form-group">
<label for="username" class="sr-only">Username</label>
<input type="text" required name="username" id="username" class="form-control" placeholder="Username">
</div>
<div class="form-group">
<label for="key" class="sr-only">Password</label>
<input type="password" required name="password" id="key" class="form-control" placeholder="Password">
</div>
<input type="submit" id="btn-login" name="signup" class="btn btn-custom btn-lg btn-block" value="Signup">
</form>
<hr>
<p style="text-align:center">
<a href="login.php">Login to your account</a>
</p>
</div>
</div>
<!-- /.col-xs-12 -->
</div>
<!-- /.row -->
</div>
<!-- /.container -->
</section>
</body>
</html>