Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
ProjectWeb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ProjectWeb
ProjectWeb
Commits
b18325cf
Commit
b18325cf
authored
Mar 15, 2019
by
wutthichai sritonwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
16/03/62
parent
a293191f
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
19 deletions
+35
-19
Home.blade.php
resources/views/Home.blade.php
+1
-1
Register.php
resources/views/Register.php
+10
-6
Test.php
resources/views/Test.php
+2
-0
login.php
resources/views/login.php
+21
-11
web.php
routes/web.php
+1
-1
No files found.
resources/views/Home.blade.php
View file @
b18325cf
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
<div
class=
"collapse navbar-collapse"
id=
"navbarSupportedContent"
>
<div
class=
"collapse navbar-collapse"
id=
"navbarSupportedContent"
>
<ul
class=
"navbar-nav"
id=
"accordion"
class=
"accordion"
>
<ul
class=
"navbar-nav"
id=
"accordion"
class=
"accordion"
>
<li
class=
"nav-item"
>
<li
class=
"nav-item"
>
<a
class=
"nav-link js-scroll-trigger"
href=
"login/"
>
เข้าสู่ระบบ
</a>
<a
class=
"nav-link js-scroll-trigger"
href=
"
register/
login/"
>
เข้าสู่ระบบ
</a>
</li>
</li>
<li
class=
"nav-item"
>
<li
class=
"nav-item"
>
<a
class=
"nav-link js-scroll-trigger"
href=
"register/"
>
สมัครสมาชิก
</a>
<a
class=
"nav-link js-scroll-trigger"
href=
"register/"
>
สมัครสมาชิก
</a>
...
...
resources/views/Register.php
View file @
b18325cf
...
@@ -75,7 +75,7 @@
...
@@ -75,7 +75,7 @@
</head>
</head>
<body>
<body>
<div
class=
"container-fluid"
>
<div
class=
"container-fluid"
>
<form
action=
"
"
method=
"
"
class=
"register-form"
>
<form
action=
"
#"
method=
"get
"
class=
"register-form"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-4 col-sm-4 col-lg-4"
>
<div
class=
"col-md-4 col-sm-4 col-lg-4"
>
<label
for=
"firstName"
>
Username
</label>
<label
for=
"firstName"
>
Username
</label>
...
@@ -84,26 +84,30 @@
...
@@ -84,26 +84,30 @@
</div>
</div>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-4 col-sm-4 col-lg-4"
>
<div
class=
"col-md-4 col-sm-4 col-lg-4"
>
<label
for=
"
email
"
>
Password
</label>
<label
for=
"
password
"
>
Password
</label>
<input
name=
"password"
class=
"form-control"
type=
"password"
>
<input
name=
"password"
class=
"form-control"
type=
"password"
>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-4 col-sm-4 col-lg-4"
>
<div
class=
"col-md-4 col-sm-4 col-lg-4"
>
<label
for=
"
password
"
>
Nickname
</label>
<label
for=
"
name
"
>
Nickname
</label>
<input
name=
"name"
class=
"form-control"
type=
"text"
>
<input
name=
"name"
class=
"form-control"
type=
"text"
>
</div>
</div>
</div>
</div>
<hr>
<hr>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-md-6 col-sm-6 col-xs-6 col-lg-6"
>
<div
class=
"col-md-6 col-sm-6 col-xs-6 col-lg-6"
>
<button
class=
"btn btn-default regbutton"
>
Register
</button
>
<a
class=
"btn btn-default regbutton"
href=
"/"
>
กลับ
</a
>
<!-- <button class="btn btn-default regbutton">กลับ</button> -->
</div>
</div>
<div
class=
"col-md-6 col-sm-6 col-xs-6 col-lg-6"
>
<div
class=
"col-md-6 col-sm-6 col-xs-6 col-lg-6"
>
<button
class=
"btn btn-default logbutton"
>
Sign up
</button>
<button
class=
"btn btn-default regbutton"
type=
"submit"
name=
"submit"
onclick=
"login"
>
สมัครใช้งาน
</button>
</div>
</div>
</div>
</div>
<center><div
class=
"col-md"
>
<a
class=
"btn btn-default regbutton"
href=
"login/"
>
Login
</a>
</div></center>
</form>
</form>
</div>
</div>
<?php
<?php
...
...
resources/views/Test.php
View file @
b18325cf
...
@@ -25,3 +25,4 @@
...
@@ -25,3 +25,4 @@
mysqli_close
(
$conn
);
mysqli_close
(
$conn
);
?>
?>
csadasdasd,a;sdlas;'dsdl;fkas;ldfka's;ldkfa;lskdf'l;askdf;'laskdf;'lkasdl;'fkas;ldfkas;'ldkfa;'lsdkf';asd'
\ No newline at end of file
resources/views/login.php
View file @
b18325cf
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<!-- <link rel="stylesheet" href="style.css"> -->
<!-- <link rel="stylesheet" href="style.css"> -->
<script
src=
"https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"
></script>
<script
src=
"https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"
></script>
<link
rel=
"stylesheet"
href=
"https://use.fontawesome.com/releases/v5.7.2/css/all.css"
>
<link
rel=
"stylesheet"
href=
"https://use.fontawesome.com/releases/v5.7.2/css/all.css"
>
<style>
<
!-- <
style>
*{
*{
font-family: "montserrat",sans-serif;
font-family: "montserrat",sans-serif;
}
}
...
@@ -52,15 +52,15 @@
...
@@ -52,15 +52,15 @@
border-radius: 6px;
border-radius: 6px;
cursor: pointer;
cursor: pointer;
}
}
</style>
</style>
-->
</head>
</head>
<body>
<body>
<div
class=
"login-box"
>
<div
class=
"login-box"
>
<form
class=
"login-form"
action=
"#"
method=
"get"
>
<form
class=
"login-form"
action=
"#"
method=
"get"
>
<h1>
Welcome
</h1>
<h1>
Welcome
</h1>
<input
class=
"txtb"
type=
"text"
name=
"U
SER
"
placeholder=
"Username"
>
<input
class=
"txtb"
type=
"text"
name=
"U
sername
"
placeholder=
"Username"
>
<input
class=
"txtb"
type=
"password"
name=
"
PASS
"
placeholder=
"Password"
>
<input
class=
"txtb"
type=
"password"
name=
"
password
"
placeholder=
"Password"
>
<input
class=
"login-btn"
type=
"submit"
name=
"submit"
value=
"
Login
"
>
<input
class=
"login-btn"
type=
"submit"
name=
"submit"
value=
"
submit
"
>
<p></p>
<p></p>
</form>
</form>
</div>
</div>
...
@@ -72,18 +72,28 @@
...
@@ -72,18 +72,28 @@
$conn
=
mysqli_connect
(
$servername
,
$username
,
$password
,
$dbname
);
$conn
=
mysqli_connect
(
$servername
,
$username
,
$password
,
$dbname
);
if
(
isset
(
$_GET
[
'submit'
])){
if
(
isset
(
$_GET
[
'submit'
])){
$users
=
$_GET
[
'USER'
];
$users
=
$_GET
[
'Username'
];
$Passs
=
$_GET
[
'PASS'
];
$Passs
=
$_GET
[
'password'
];
// echo ($users.$Passs);
$sql
=
"SELECT * FROM `USERS`"
;
$sql
=
"SELECT * FROM `USERS`"
;
$result
=
mysqli_query
(
$conn
,
$sql
);
$result
=
mysqli_query
(
$conn
,
$sql
);
$a
=
array
();
if
(
mysqli_num_rows
(
$result
)
>
0
)
{
if
(
mysqli_num_rows
(
$result
)
>
0
)
{
while
(
$row
=
mysqli_fetch_array
(
$result
,
MYSQLI_BOTH
))
{
while
(
$row
=
mysqli_fetch_array
(
$result
,
MYSQLI_BOTH
))
{
if
(
$users
==
$row
[
1
]){
$a
[
$row
[
1
]]
=
$row
[
2
];
echo
'กรุณากรอกข้อมูล1'
;
}
}
else
if
(
$Passs
==
$row
[
2
]){
if
(
array_key_exists
(
$users
,
$a
)){
echo
'กรุณากรอกข้อมูล2'
;
if
(
$Passs
==
$a
[
$users
]){
echo
"Welcome "
.
$users
;
}
else
{
echo
"Wrong password"
;
}
}
}
}
else
{
echo
"Unknown username "
;
}
}
else
{
}
else
{
echo
"0 results"
;
echo
"0 results"
;
}}
}}
...
...
routes/web.php
View file @
b18325cf
...
@@ -15,7 +15,7 @@ Route::get('/', function () {
...
@@ -15,7 +15,7 @@ Route::get('/', function () {
return
view
(
'Home'
);
return
view
(
'Home'
);
});
});
Route
::
get
(
'/login'
,
function
()
{
Route
::
get
(
'/
register/
login'
,
function
()
{
return
view
(
'Login'
);
return
view
(
'Login'
);
});
});
...
...
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