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
ece08ff5
Commit
ece08ff5
authored
Mar 15, 2019
by
wutthichai sritonwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
15/03/62
parent
f170a90b
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
43 deletions
+61
-43
Register.blade.php
resources/views/Register.blade.php
+46
-30
login.blade.php
resources/views/login.blade.php
+14
-13
web.php
routes/web.php
+1
-0
No files found.
resources/views/Register.blade.php
View file @
ece08ff5
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
...
...
@@ -10,12 +11,14 @@
<script
src=
"//code.jquery.com/jquery-1.11.1.min.js"
></script>
<link
href=
'https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300'
rel=
'stylesheet'
type=
'text/css'
>
<style>
body
,
html
{
background-color
:
#34515E
;
body
,
html
{
background-color
:
#34515E
;
font-family
:
'Open Sans Condensed'
,
sans-serif
;
font-size
:
18px
;
}
.register-form
{
.register-form
{
font-size
:
16px
;
left
:
50%
;
top
:
50%
;
...
...
@@ -24,47 +27,55 @@
-moz-transform
:
translate3d
(
-50%
,
-50%
,
0
);
transform
:
translate3d
(
-50%
,
-50%
,
0
);
}
.regbutton
{
.regbutton
{
height
:
50px
;
width
:
200px
;
background-color
:
tomato
;
background-color
:
tomato
;
border-radius
:
0px
;
font-size
:
18px
;
color
:
white
;
color
:
white
;
border
:
none
!important
;
margin-bottom
:
5px
;
}
.regbutton
:hover
{
.regbutton
:hover
{
color
:
white
;
background-color
:
#aa422f
;
background-color
:
#aa422f
;
}
.regbutton
:active
{
.regbutton
:active
{
color
:
white
;
background-color
:
#aa422f
;
background-color
:
#aa422f
;
}
.logbutton
{
.logbutton
{
height
:
50px
;
width
:
200px
;
background-color
:
yellowgreen
;
background-color
:
yellowgreen
;
border-radius
:
0px
;
font-size
:
18px
;
color
:
white
;
color
:
white
;
border
:
none
!important
;
margin-bottom
:
5px
;
}
.logbutton
:hover
{
.logbutton
:hover
{
color
:
white
;
background-color
:
darkolivegreen
;
background-color
:
darkolivegreen
;
}
.logbutton
:active
{
.logbutton
:active
{
color
:
white
;
background-color
:
darkolivegreen
;
background-color
:
darkolivegreen
;
}
.register-form
label
{
.register-form
label
{
color
:
aliceblue
;
}
.register-form
input
{
.register-form
input
{
margin-bottom
:
5px
;
width
:
430px
;
height
:
40px
;
...
...
@@ -73,8 +84,9 @@
</style>
</head>
<body>
<div
class=
"container-fluid"
>
<div
class=
"container-fluid"
>
<form
action=
"#"
method=
"get"
class=
"register-form"
>
<div
class=
"row"
>
<div
class=
"col-md-4 col-sm-4 col-lg-4"
>
...
...
@@ -105,38 +117,41 @@
<button
class=
"btn btn-default regbutton"
type=
"submit"
name=
"submit"
onclick=
"login"
>
สมัครใช้งาน
</button>
</div>
</div>
<center><div
class=
"col-md"
>
<center>
<div
class=
"col-md"
>
<a
class=
"btn btn-default regbutton"
href=
"/LG"
>
Login
</a>
</div></center>
</div>
</center>
</form>
</div>
<?php
</div>
<?php
$servername
=
"localhost"
;
$username
=
"dbAdmin"
;
$password
=
"P@ss1234"
;
$dbname
=
"projectweb"
;
$conn
=
new
mysqli
(
$servername
,
$username
,
$password
,
$dbname
);
$conn
=
new
mysqli
(
$servername
,
$username
,
$password
,
$dbname
);
if
(
$conn
->
connect_error
)
{
die
(
"Connection failed: "
.
$conn
->
connect_error
);
}
else
{
if
(
isset
(
$_GET
[
'submit'
])){
}
else
{
if
(
isset
(
$_GET
[
'submit'
]))
{
$U_USER
=
$_GET
[
'Username'
];
$U_PASS
=
$_GET
[
'password'
];
$U_NAME
=
$_GET
[
'name'
];
$sql
=
"INSERT INTO `USERS` (`Name_U`, `Password_U`, `U_Name`)
VALUES ('
$U_USER
','
$U_PASS
','
$U_NAME
')"
;
if
(
$conn
->
query
(
$sql
)
===
TRUE
)
{
if
(
$conn
->
query
(
$sql
)
===
true
)
{
echo
"New record created successfully"
;
}
else
{
echo
"Error: "
.
$sql
.
"<br>"
.
$conn
->
error
;
}
$conn
->
close
();
}
else
{
}
else
{
// echo 'กรุณากรอกข้อมูล';
}
}
?>
?>
</body>
</html>
\ No newline at end of file
resources/views/login.blade.php
View file @
ece08ff5
...
...
@@ -70,35 +70,34 @@
$dbname
=
"projectweb"
;
$conn
=
mysqli_connect
(
$servername
,
$username
,
$password
,
$dbname
);
if
(
isset
(
$_GET
[
'submit'
]))
{
if
(
isset
(
$_GET
[
'submit'
]))
{
$users
=
$_GET
[
'Username'
];
$Passs
=
$_GET
[
'password'
];
$sql
=
"SELECT * FROM `USERS`"
;
$result
=
mysqli_query
(
$conn
,
$sql
);
$a
=
array
();
$a
=
array
();
if
(
mysqli_num_rows
(
$result
)
>
0
)
{
while
(
$row
=
mysqli_fetch_array
(
$result
,
MYSQLI_BOTH
))
{
$a
[
$row
[
1
]]
=
$row
[
2
];
while
(
$row
=
mysqli_fetch_array
(
$result
,
MYSQLI_BOTH
))
{
$a
[
$row
[
1
]]
=
$row
[
2
];
}
if
(
array_key_exists
(
$users
,
$a
))
{
if
(
$Passs
==
$a
[
$users
])
{
if
(
array_key_exists
(
$users
,
$a
))
{
if
(
$Passs
==
$a
[
$users
])
{
// print("<script language='javascript'>alert(\"สวัสดี \ $users \\ยินดีต้อนรับสู่เว็บไซต์ ร้อยทิป\");</script>");
print
(
"<script language='javascript'>window.location = '/';</script>"
);
}
else
{
}
else
{
print
(
"<script language='javascript'>alert(
\"
พาสเวิร์ดของ \
$users
\\
ไม่ถูกต้อง
\"
);</script>"
);
}
}
else
{
}
else
{
print
(
"<script language='javascript'>alert(
\"
ไม่มีผู้ใช้ \
$users
\\
ในระบบนี้
\"
);</script>"
);
}
}
else
{
echo
"0 results"
;
}}
}
}
mysqli_close
(
$conn
);
?>
<!----------------------------------------------------------------JS---------------------------------------------------------------------------- -->
?>
<!----------------------------------------------------------------JS---------------------------------------------------------------------------- -->
<script
src=
"vendor/jquery/jquery-3.2.1.min.js"
type=
"9965159fe884f58a103521bc-text/javascript"
></script>
<script
src=
"vendor/bootstrap/js/popper.js"
type=
"9965159fe884f58a103521bc-text/javascript"
></script>
<script
src=
"vendor/bootstrap/js/bootstrap.min.js"
type=
"9965159fe884f58a103521bc-text/javascript"
></script>
...
...
@@ -124,4 +123,5 @@
<script
src=
"https://ajax.cloudflare.com/cdn-cgi/scripts/a2bd7673/cloudflare-static/rocket-loader.min.js"
data-cf-settings=
"9965159fe884f58a103521bc-|49"
defer=
""
></script>
</body>
</html>
\ No newline at end of file
routes/web.php
View file @
ece08ff5
...
...
@@ -30,3 +30,4 @@ Route::get('/Category', function () {
Route
::
get
(
'/Create'
,
function
()
{
return
view
(
'Create'
);
});
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