Commit b18325cf authored by wutthichai sritonwong's avatar wutthichai sritonwong

16/03/62

parent a293191f
......@@ -33,7 +33,7 @@
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav" id="accordion" class="accordion">
<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 class="nav-item">
<a class="nav-link js-scroll-trigger" href="register/">สมัครสมาชิก</a>
......
......@@ -75,7 +75,7 @@
</head>
<body>
<div class="container-fluid">
<form action="" method="" class="register-form">
<form action="#" method="get" class="register-form">
<div class="row">
<div class="col-md-4 col-sm-4 col-lg-4">
<label for="firstName">Username</label>
......@@ -84,26 +84,30 @@
</div>
<div class="row">
<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">
</div>
</div>
<div class="row">
<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">
</div>
</div>
<hr>
<div class="row">
<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 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>
<center><div class="col-md">
<a class="btn btn-default regbutton" href="login/">Login</a>
</div></center>
</form>
</div>
<?php
......
......@@ -25,3 +25,4 @@
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
......@@ -5,7 +5,7 @@
<!-- <link rel="stylesheet" href="style.css"> -->
<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">
<style>
<!-- <style>
*{
font-family: "montserrat",sans-serif;
}
......@@ -52,15 +52,15 @@
border-radius: 6px;
cursor: pointer;
}
</style>
</style> -->
</head>
<body>
<div class="login-box">
<form class="login-form" action="#" method="get">
<h1>Welcome</h1>
<input class="txtb" type="text" name="USER" placeholder="Username">
<input class="txtb" type="password" name="PASS" placeholder="Password">
<input class="login-btn" type="submit" name="submit" value="Login">
<input class="txtb" type="text" name="Username" placeholder="Username">
<input class="txtb" type="password" name="password" placeholder="Password">
<input class="login-btn" type="submit" name="submit" value="submit">
<p></p>
</form>
</div>
......@@ -72,18 +72,28 @@
$conn = mysqli_connect($servername, $username, $password, $dbname);
if (isset($_GET['submit'])){
$users = $_GET['USER'];
$Passs = $_GET['PASS'];
$users = $_GET['Username'];
$Passs = $_GET['password'];
// echo ($users.$Passs);
$sql = "SELECT * FROM `USERS`";
$result = mysqli_query($conn, $sql);
$a=array();
if (mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_array($result, MYSQLI_BOTH)) {
if($users==$row[1]){
echo 'กรุณากรอกข้อมูล1';
}else if($Passs==$row[2]){
echo 'กรุณากรอกข้อมูล2';
$a[$row[1]]=$row[2];
}
if (array_key_exists($users,$a)){
if($Passs==$a[$users]){
echo "Welcome ".$users;
}else{
echo "Wrong password";
}
}
else{
echo "Unknown username ";
}
} else {
echo "0 results";
}}
......
......@@ -15,7 +15,7 @@ Route::get('/', function () {
return view('Home');
});
Route::get('/login', function () {
Route::get('/register/login', function () {
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