Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Photogram project PHP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Raghav
Photogram project PHP
Commits
0deeeff3
Commit
0deeeff3
authored
1 month ago
by
Raghav
Browse files
Options
Downloads
Patches
Plain Diff
Added new page if Credential true with POST: Success
parent
c82d6af3
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
_templates/login-content.php
+22
-1
22 additions, 1 deletion
_templates/login-content.php
html
+1
-0
1 addition, 0 deletions
html
libs/load.php
+8
-0
8 additions, 0 deletions
libs/load.php
with
31 additions
and
1 deletion
_templates/login-content.php
+
22
−
1
View file @
0deeeff3
<form
action=
"/photogram-project-php/test.php"
method=
"post"
>
<?
// Getting the values from the form and storing them in variables.
$username
=
$_POST
[
'email'
];
$password
=
$_POST
[
'password'
];
$validate
=
validate_credentials
(
$username
,
$password
);
if
(
$validate
){
?>
<!-- If it is true is display true page -->
<main
class=
"container"
>
<div
class=
"bg-body-tertiary p-5 rounded"
>
<h1>
Login Success
</h1>
<p
class=
"lead"
>
This example is a quick exercise to illustrate How to login with simple POST method
</p>
<a
class=
"btn btn-lg btn-primary"
href=
"/docs/5.3/components/navbar/"
role=
"button"
>
View navbar docs »
</a>
</div>
</main>
<?
}
else
{
?>
<!-- If it is false it displays the login form -->
<main
class=
"form-signin w-100 m-auto"
>
<form
action=
"/photogram-project-php/login.php"
method=
"post"
>
<img
class=
"mb-4 center"
src=
"/photogram-project-php/assets/brand/devyani_logo_edit_light copy.svg"
alt=
""
width=
"72"
height=
"77"
>
<img
class=
"mb-4 center"
src=
"/photogram-project-php/assets/brand/devyani_logo_edit_light copy.svg"
alt=
""
width=
"72"
height=
"77"
>
<h1
class=
"h3 mb-3 fw-normal"
>
Please sign in
</h1>
<h1
class=
"h3 mb-3 fw-normal"
>
Please sign in
</h1>
...
@@ -20,3 +38,6 @@
...
@@ -20,3 +38,6 @@
<button
class=
"hvr-grow-shadow btn btn-primary w-100 py-2 "
type=
"submit"
>
Sign in
</button>
<button
class=
"hvr-grow-shadow btn btn-primary w-100 py-2 "
type=
"submit"
>
Sign in
</button>
</form>
</form>
</main>
<?
}
?>
This diff is collapsed.
Click to expand it.
html
0 → 120000
+
1
−
0
View file @
0deeeff3
/home/raghav_gr/htdocs/var/www/html
\ No newline at end of file
This diff is collapsed.
Click to expand it.
libs/load.php
+
8
−
0
View file @
0deeeff3
...
@@ -3,4 +3,12 @@
...
@@ -3,4 +3,12 @@
include
$_SERVER
[
'DOCUMENT_ROOT'
]
.
"/photogram-project-php/_templates/
$name
.php"
;
include
$_SERVER
[
'DOCUMENT_ROOT'
]
.
"/photogram-project-php/_templates/
$name
.php"
;
}
}
function
validate_credentials
(
$username
,
$password
){
if
(
$username
==
"raghav@gmail.com"
and
$password
==
"raghav"
){
return
true
;
}
else
{
return
false
;
}
}
?>
?>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment