-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
141 lines (128 loc) · 4.39 KB
/
index.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?php
session_start();
?>
<?php
include "./dbcon.php";
$ua = false;
if(isset($_POST['submit'])){
$username = mysqli_real_escape_string($con,$_POST['username']);
$password = mysqli_real_escape_string($con,$_POST['password']);
$pass = password_hash($password,PASSWORD_BCRYPT);
$userquery = "select * from login where username = '$username'";
$query = mysqli_query($con,$userquery);
$usercount = mysqli_num_rows($query);
if($usercount > 0){
$ua = true;
}
else{
$sql = "INSERT INTO `login`(`username`, `password`) VALUES ($username','$pass')";
$iquery = mysqli_query($con,$sql);
$_SESSION['username'] = $username;
$_SESSION['Auth'] = true;
header('location:index2.php');
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Assessment Test</title>
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap" rel="stylesheet">
</head>
<body>
<section class="home">
<nav>
<div class="left">
<div class="foo-logo">
<span>
logo
</span>
</div>
<div class="heading">
<h1>
Football Picker
</h1>
</div>
</div>
<!-- <div class="nav-page">
<button class="active">Page1</button>
<a href="./index2.html">
<button>Page2</button>
</a>
</div> -->
</nav>
<div class="login">
<div class="txt">
<h1>All About <br><span>Sports</span></h1>
<p>
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Molestiae laboriosam eaque quae eveniet
cumque qui, totam nesciunt cum, iste ea modi voluptatum voluptas, ipsa odio facilis rem omnis sint!
Tenetur?Lorem ipsum dolor, sit amet consectetur adipisicing elit. Nihil quo voluptate, officia
dolores in illum sed nam harum temporibus reiciendis doloribus ea incidunt eius consequuntur.
Laudantium doloribus vitae dolore tempore.
</p>
</div>
<div class="login-box">
<h1>
Login
</h1>
<p>
<?php
if($ua){
echo "UserName Already Exists";
}
?>
</p>
<form action="" method="post">
<div class="log-input">
<input type="text" style="display:none;" name="user_id">
<input type="text" name="username" placeholder="Username" required>
<input type="password" name="password" placeholder="password" required>
<button type="submit" name="submit">Login</button>
</div>
</form>
</div>
</div>
<div class="we-do">
<div class="box">
<div class="box-top">
<h1>What we do?</h1>
</div>
</div>
<div class="box">
<div class="box-top">
<h1>What we do?</h1>
</div>
</div>
<div class="box">
<div class="box-top">
<h1>What we do?</h1>
</div>
</div>
<div class="box">
<div class="box-top">
<h1>What we do?</h1>
</div>
</div>
</div>
<footer class="sport-footer">
<div class="foo-logo">
<span>
logo
</span>
</div>
<div class="heading">
<h1>
Football Picker
</h1>
</div>
</footer>
</section>
</body>
</html>
<?php
$con->close();
?>