Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
20_21-J09
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
20_21-J09
20_21-J09
Commits
27ceabdf
Commit
27ceabdf
authored
Jul 08, 2021
by
Janith Madushanka_IT17142656
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
'created_login.php'
parent
dae6feb6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
0 deletions
+69
-0
login.php
login.php
+69
-0
No files found.
login.php
0 → 100644
View file @
27ceabdf
<?php
include
(
'config/apply.php'
);
include
(
'../box/header.php'
);
?>
<!--Body Starts Here-->
<div
class=
"main"
>
<div
class=
"login"
>
<form
method=
"post"
action=
""
>
<h2>
Admin | Log In
</h2>
<?php
if
(
isset
(
$_SESSION
[
'validation'
]))
{
echo
$_SESSION
[
'validation'
];
unset
(
$_SESSION
[
'vaidation'
]);
}
if
(
isset
(
$_SESSION
[
'fail'
]))
{
echo
$_SESSION
[
'fail'
];
unset
(
$_SESSION
[
'fail'
]);
}
if
(
isset
(
$_SESSION
[
'xss'
]))
{
echo
$_SESSION
[
'xss'
];
unset
(
$_SESSION
[
'xss'
]);
}
?>
<input
type=
"text"
name=
"username"
placeholder=
"Username"
required=
"true"
/>
<input
type=
"password"
name=
"password"
placeholder=
"Password"
required=
"true"
/>
<input
type=
"submit"
name=
"submit"
value=
"Log In"
class=
"btn-go"
/>
<input
type=
"reset"
name=
"reset"
value=
"Reset"
class=
"btn-exit"
/>
</form>
<?php
if
(
isset
(
$_POST
[
'submit'
]))
{
//echo "Clicked";
$username
=
$obj
->
sanitize
(
$conn
,
$_POST
[
'username'
]);
$password_db
=
md5
(
$obj
->
sanitize
(
$conn
,
$_POST
[
'password'
]));
if
((
$username
==
""
)
or
(
$password
=
""
))
{
$_SESSION
[
'validation'
]
=
"<div class='error'>Username or Password is Empty</div>"
;
header
(
'location:'
.
SITEURL
.
'admin/login.php'
);
}
$tbl_name
=
"tbl_app"
;
$where
=
"username='
$username
' AND password='
$password_db
'"
;
$query
=
$obj
->
select_data
(
$tbl_name
,
$where
);
$res
=
$obj
->
execute_query
(
$conn
,
$query
);
$count_rows
=
$obj
->
num_rows
(
$res
);
if
(
$count_rows
==
1
)
{
$_SESSION
[
'user'
]
=
$username
;
$_SESSION
[
'success'
]
=
"<div class='success'>Login Successful. Welcome "
.
$username
.
" to dashboard.</div>"
;
header
(
'location:'
.
SITEURL
.
'admin/index.php'
);
}
else
{
$_SESSION
[
'fail'
]
=
"<div class='error'>Username or Password is invalid. Please try again.</div>"
;
header
(
'location:'
.
SITEURL
.
'admin/login.php'
);
}
}
?>
</div>
</div>
<!--Body Ends Here-->
<?php
include
(
'../box/footer.php'
);
?>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment