FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
T2-Web-Programming/login.php at main · MilkyWay2k/T2-Web-Programming · GitHub
MilkyWay2k
/
T2-Web-Programming
Public
Notifications
You must be signed in to change notification settings
Fork
1
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
T2-Web-Programming
/
login.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
90 lines (64 loc) · 2.25 KB
Breadcrumbs
T2-Web-Programming
/
login.php
Copy path
File metadata and controls
90 lines (64 loc) · 2.25 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
<?php
session_start
();
$
title
=
"
Skate Shop - Login
"
;
$
stylesheet
=
"
login
"
;
$
extra
=
""
;
include
"
partials/header.php
"
;
include
"
partials/db.php
"
;
if
(
isset
(
$
_POST
[
"
submit
"
])) {
$
username
=
$
_POST
[
"
uid
"
];
$
pwd
=
$
_POST
[
"
pwd
"
];
$
stmt
=
mysqli_prepare
(
$
conn
,
"
SELECT * FROM customer WHERE username=?
"
);
mysqli_stmt_bind_param
(
$
stmt
,
"
s
"
,
$
username
);
mysqli_stmt_execute
(
$
stmt
);
$
result
=
mysqli_stmt_get_result
(
$
stmt
);
if
(
$
row
=
mysqli_fetch_assoc
(
$
result
)){
if
(
password_verify
(
$
pwd
,
$
row
[
'
password
'
])) {
$
_SESSION
[
"
userid
"
] =
$
row
[
"
customer_id
"
];
$
_SESSION
[
"
useruid
"
] =
$
row
[
"
username
"
];
exit
();
}
else
{
echo
"
fuck
"
;
exit
();
}
}
else
{
echo
"
fuck
"
;
exit
();
}
mysqli_stmt_close
(
$
stmt
);
}
?>
<div class="container reg_form">
<form class="row justify-content-center" method="post" action="profile.php">
<h3>Welcome back!</h3>
<div class="mb-3 col-12 col-md-4">
<label for="username" class="form-label">Username</label>
<input type="text" class="form-control" name = "uid" placeholder="enter you username">
</div>
<div class="w-100"></div>
<div class="mb-3 col-12 col-md-4">
<label for="password" class="form-label">Password</label>
<input type="password" name = "pwd" class="form-control" aria-describedby="passwordHelpBlock">
</div>
<div class="w-100"></div>
<div class="mb-3 col-12 col-md-4">
<button type="submit" name="submit" class="btn btn-success" href="shop.php">Log in</button>
<a class="reg" href="registration.php">Registration</a>
</div>
<div class="w-100"></div>
<div class="mb-3 col-12 col-md-4">
<?php
if
(
isset
(
$
_GET
[
"
error
"
])) {
if
(
$
_GET
[
"
error
"
] ==
"
emptyinput
"
) {
echo
"
<p>Fill in all fields</p>
"
;
}
else
if
(
$
_GET
[
"
error
"
] ==
"
wronglogin
"
) {
echo
"
<p>Incorrect login</p>
"
;
}
}
?>
</div>
</form>
</div>
<?php
include
'
partials/footer.php
'
;
?>
Back
|
FazBrowse Home
|
New Git URL