Commit ece08ff5 authored by wutthichai sritonwong's avatar wutthichai sritonwong

15/03/62

parent f170a90b
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title> <title>Document</title>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <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'> <link href='https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300' rel='stylesheet' type='text/css'>
<style> <style>
body, html{ body,
background-color:#34515E; html {
font-family: 'Open Sans Condensed', sans-serif; background-color: #34515E;
font-size: 18px; font-family: 'Open Sans Condensed', sans-serif;
} font-size: 18px;
.register-form{ }
font-size: 16px;
left: 50%; .register-form {
top: 50%; font-size: 16px;
position: absolute; left: 50%;
-webkit-transform: translate3d(-50%, -50%, 0); top: 50%;
-moz-transform: translate3d(-50%, -50%, 0); position: absolute;
transform: translate3d(-50%, -50%, 0); -webkit-transform: translate3d(-50%, -50%, 0);
} -moz-transform: translate3d(-50%, -50%, 0);
.regbutton{ transform: translate3d(-50%, -50%, 0);
height: 50px; }
width: 200px;
background-color:tomato; .regbutton {
border-radius: 0px; height: 50px;
font-size: 18px; width: 200px;
color:white; background-color: tomato;
border: none !important; border-radius: 0px;
margin-bottom: 5px; font-size: 18px;
} color: white;
.regbutton:hover{ border: none !important;
color: white; margin-bottom: 5px;
background-color:#aa422f; }
}
.regbutton:active{ .regbutton:hover {
color: white; color: white;
background-color:#aa422f; background-color: #aa422f;
} }
.logbutton{
height: 50px; .regbutton:active {
width: 200px; color: white;
background-color:yellowgreen; background-color: #aa422f;
border-radius: 0px; }
font-size: 18px;
color:white; .logbutton {
border: none !important; height: 50px;
margin-bottom: 5px; width: 200px;
} background-color: yellowgreen;
.logbutton:hover{ border-radius: 0px;
color: white; font-size: 18px;
background-color:darkolivegreen; color: white;
} border: none !important;
.logbutton:active{ margin-bottom: 5px;
color: white; }
background-color:darkolivegreen;
} .logbutton:hover {
.register-form label{ color: white;
color: aliceblue; background-color: darkolivegreen;
}
}
.register-form input{ .logbutton:active {
margin-bottom: 5px; color: white;
width: 430px; background-color: darkolivegreen;
height: 40px; }
border-radius: 0px;
} .register-form label {
</style> color: aliceblue;
}
.register-form input {
margin-bottom: 5px;
width: 430px;
height: 40px;
border-radius: 0px;
}
</style>
</head> </head>
<body> <body>
<div class="container-fluid"> <div class="container-fluid">
<form action="#" method="get" 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>
<input name="Username" class="form-control" type="text"> <input name="Username" class="form-control" type="text">
</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">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="name">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">
<a class="btn btn-default regbutton" href="/">กลับ</a> <a class="btn btn-default regbutton" href="/">กลับ</a>
<!-- <button class="btn btn-default regbutton">กลับ</button> --> <!-- <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 regbutton" type="submit" name="submit" onclick="login">สมัครใช้งาน</button> <button class="btn btn-default regbutton" type="submit" name="submit" onclick="login">สมัครใช้งาน</button>
</div> </div>
</div> </div>
<center><div class="col-md"> <center>
<a class="btn btn-default regbutton" href="/LG">Login</a> <div class="col-md">
</div></center> <a class="btn btn-default regbutton" href="/LG">Login</a>
</form> </div>
</div> </center>
<?php </form>
</div>
<?php
$servername = "localhost"; $servername = "localhost";
$username = "dbAdmin"; $username = "dbAdmin";
$password = "P@ss1234"; $password = "P@ss1234";
$dbname = "projectweb"; $dbname = "projectweb";
$conn = new mysqli($servername,$username,$password,$dbname); $conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) { if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error); die("Connection failed: " . $conn->connect_error);
}else{ } else {
if (isset($_GET['submit'])){ if (isset($_GET['submit'])) {
$U_USER = $_GET['Username']; $U_USER = $_GET['Username'];
$U_PASS = $_GET['password']; $U_PASS = $_GET['password'];
$U_NAME = $_GET['name']; $U_NAME = $_GET['name'];
$sql = "INSERT INTO `USERS` (`Name_U`, `Password_U`, `U_Name`) $sql = "INSERT INTO `USERS` (`Name_U`, `Password_U`, `U_Name`)
VALUES ('$U_USER','$U_PASS','$U_NAME')"; VALUES ('$U_USER','$U_PASS','$U_NAME')";
if ($conn->query($sql) === TRUE) { if ($conn->query($sql) === true) {
echo "New record created successfully"; echo "New record created successfully";
} else { } else {
echo "Error: " . $sql . "<br>" . $conn->error; echo "Error: " . $sql . "<br>" . $conn->error;
} }
$conn->close(); $conn->close();
}else{ } else {
// echo 'กรุณากรอกข้อมูล'; // echo 'กรุณากรอกข้อมูล';
} }
} }
?> ?>
</body> </body>
</html>
\ No newline at end of file </html>
\ No newline at end of file
...@@ -64,41 +64,40 @@ ...@@ -64,41 +64,40 @@
</div> </div>
</div> </div>
<?php <?php
$servername = "localhost"; $servername = "localhost";
$username = "dbAdmin"; $username = "dbAdmin";
$password = "P@ss1234"; $password = "P@ss1234";
$dbname = "projectweb"; $dbname = "projectweb";
$conn = mysqli_connect($servername, $username, $password, $dbname); $conn = mysqli_connect($servername, $username, $password, $dbname);
if (isset($_GET['submit'])){ if (isset($_GET['submit'])) {
$users = $_GET['Username']; $users = $_GET['Username'];
$Passs = $_GET['password']; $Passs = $_GET['password'];
$sql = "SELECT * FROM `USERS`"; $sql = "SELECT * FROM `USERS`";
$result = mysqli_query($conn, $sql); $result = mysqli_query($conn, $sql);
$a=array(); $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)) {
$a[$row[1]]=$row[2]; $a[$row[1]] = $row[2];
} }
if (array_key_exists($users,$a)){ if (array_key_exists($users, $a)) {
if($Passs==$a[$users]){ if ($Passs == $a[$users]) {
// print("<script language='javascript'>alert(\"สวัสดี \ $users \\ยินดีต้อนรับสู่เว็บไซต์ ร้อยทิป\");</script>"); // print("<script language='javascript'>alert(\"สวัสดี \ $users \\ยินดีต้อนรับสู่เว็บไซต์ ร้อยทิป\");</script>");
print("<script language='javascript'>window.location = '/';</script>"); print("<script language='javascript'>window.location = '/';</script>");
}else{ } else {
print("<script language='javascript'>alert(\"พาสเวิร์ดของ \ $users \\ไม่ถูกต้อง\");</script>"); print("<script language='javascript'>alert(\"พาสเวิร์ดของ \ $users \\ไม่ถูกต้อง\");</script>");
} }
} } else {
else{ print("<script language='javascript'>alert(\"ไม่มีผู้ใช้ \ $users \\ในระบบนี้\");</script>");
print("<script language='javascript'>alert(\"ไม่มีผู้ใช้ \ $users \\ในระบบนี้\");</script>"); }
} else {
} echo "0 results";
} else { }
echo "0 results"; }
}} mysqli_close($conn);
mysqli_close($conn); ?>
?> <!----------------------------------------------------------------JS---------------------------------------------------------------------------- -->
<!----------------------------------------------------------------JS---------------------------------------------------------------------------- -->
<script src="vendor/jquery/jquery-3.2.1.min.js" type="9965159fe884f58a103521bc-text/javascript"></script> <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/popper.js" type="9965159fe884f58a103521bc-text/javascript"></script>
<script src="vendor/bootstrap/js/bootstrap.min.js" type="9965159fe884f58a103521bc-text/javascript"></script> <script src="vendor/bootstrap/js/bootstrap.min.js" type="9965159fe884f58a103521bc-text/javascript"></script>
...@@ -124,4 +123,5 @@ ...@@ -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> <script src="https://ajax.cloudflare.com/cdn-cgi/scripts/a2bd7673/cloudflare-static/rocket-loader.min.js" data-cf-settings="9965159fe884f58a103521bc-|49" defer=""></script>
</body> </body>
</html> </html>
\ No newline at end of file
...@@ -29,4 +29,5 @@ Route::get('/Category', function () { ...@@ -29,4 +29,5 @@ Route::get('/Category', function () {
Route::get('/Create', function () { Route::get('/Create', function () {
return view('Create'); return view('Create');
}); });
\ No newline at end of file
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