Commit b18325cf authored by wutthichai sritonwong's avatar wutthichai sritonwong

16/03/62

parent a293191f
...@@ -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>
......
...@@ -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">
<button class="btn btn-default logbutton">Sign up</button> <div class="col-md-6 col-sm-6 col-xs-6 col-lg-6">
</div> <button class="btn btn-default regbutton" type="submit" name="submit" onclick="login">สมัครใช้งาน</button>
</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
......
...@@ -24,4 +24,5 @@ ...@@ -24,4 +24,5 @@
} }
mysqli_close($conn); mysqli_close($conn);
?> ?>
\ No newline at end of file csadasdasd,a;sdlas;'dsdl;fkas;ldfka's;ldkfa;lskdf'l;askdf;'laskdf;'lkasdl;'fkas;ldfkas;'ldkfa;'lsdkf';asd'
\ No newline at end of file
...@@ -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="USER" placeholder="Username"> <input class="txtb" type="text" name="Username" 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";
}} }}
......
...@@ -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');
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment