Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
webisite
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
stephanie.smith
webisite
Commits
5e0d4a21
Commit
5e0d4a21
authored
May 17, 2022
by
stephanie.smith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
php
parent
3fed4577
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
25 deletions
+29
-25
login.html
login.html
+3
-3
login.php
login.php
+0
-22
readdata.php
readdata.php
+26
-0
No files found.
login.html
View file @
5e0d4a21
...
@@ -27,13 +27,13 @@
...
@@ -27,13 +27,13 @@
<h2>
Login
</h2>
<h2>
Login
</h2>
</div>
</div>
<div
class=
"card-body"
>
<div
class=
"card-body"
>
<form
action =
"
login
.php"
method=
"post"
>
<form
action =
"
readdata
.php"
method=
"post"
>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
for=
"email"
>
Email
</label>
<label
for=
"email"
>
Email
</label>
<input
type=
"email"
id=
"email"
class=
"form-control"
name=
"email"
required
>
<input
type=
"email"
id=
"email"
class=
"form-control"
name=
"email"
required
>
<label
for=
"pass
word
"
>
Password
</label>
<label
for=
"pass"
>
Password
</label>
<input
type=
"pass
word"
id=
"password"
class=
"form-control"
name=
"password"
required
>
<input
type=
"pass
"
id=
"pass"
class=
"form-control"
name=
"pass"
required
>
</div>
</div>
<input
type=
"submit"
class=
"btn btn-primary w-100"
value=
"Login"
name=
""
>
<input
type=
"submit"
class=
"btn btn-primary w-100"
value=
"Login"
name=
""
>
</form>
</form>
...
...
login.php
deleted
100644 → 0
View file @
3fed4577
<?php
$email
=
$_POST
[
'emial'
];
$password
=
$_POST
[
'password'
];
//connection
$con
=
new
mysqli
(
"localhost"
,
"root"
,
""
,
"test"
);
if
(
$con
->
connect_error
){
die
(
"failed to connect: "
.
$con
->
connect_error
);
}
else
{
$stmt
=
$con
->
prepare
(
"select * from registration where email = ?"
);
$stmt
->
bind_param
(
"s"
,
$email
);
$stmt
->
execute
();
$stmt_result
=
$stmt
->
get_result
();
if
(
$stmt_result
->
num_rows
>
0
){
if
(
$data
[
'password'
]
===
$password
)
echo
"<h2>Login successful</h2>"
;
}
else
{
echo
"<h2>Invalid email or password</h2>"
;
}
}
?>
\ No newline at end of file
readdata.php
0 → 100644
View file @
5e0d4a21
<html>
<head>
</head>
<body>
<?php
if
(
isset
(
$_POST
[
'email'
],
$_POST
[
'pass'
])){
$conn
=
mysqli_connect
(
'localhost:3306'
,
'stephanie.smith'
,
'0lnKdVkBKy'
,
'stephaniesmith_database'
);
$sql
=
"INSERT INTO dataa (Email,Passwords) VALUES ('
$email
','
$pass
')"
;
$email
=
$_POST
[
'email'
];
$pass
=
$_POST
[
'pass'
];
if
(
mysqli_connect_errno
())
{
echo
"Failed to connect to MySQL: "
.
mysqli_connect_error
();
}
if
(
mysqli_query
(
$conn
,
$sql
))
{
echo
"Record added"
;
}
mysqli_close
(
$conn
);
}
?>
</body>
</html>
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