|
|
|
ต้องการให้มีการใส่ Password ที่ถูกต้องใน Form ก่อนถึงจะทำการ Update Database ได้ ต้องทำยังไงครับ |
|
|
|
|
|
|
|
--------------------------------------------------------------------------------------------------------
<html>
<head>
<title>Update Info</title>
<style>
input[type="submit"]{
font-size: 16px;
background: linear-gradient(#483D8B 5%, #483D8B 100%);
border: 1px solid #483D8B;
color: #FFFFFF;
font-weight: bold;
cursor: pointer;
width: 15%;
border-radius: 5px;
padding: 10px 0;
outline:none;
}
input[type=submit]:hover{
background: linear-gradient(#008000 5%, #008000 100%);
}
</style>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body style="background-color:#DAA520 ;">
<h2 align="center"><font color="red"><b>ATTENTION !!</b></font></h2>
<h2 align="center"><font color="red"><b>Information can be updated with correct PIN code.</b></font></h2>
<center>
<font size="4">PIN Code : <input type="password" size="20" STYLE="color: #000000; font-family: Verdana; font-weight: bold; font-size : width: 30%; height: 30px; background-color: #808080;" id="password" name="password"><br><br>
</center>
<center>
<form action="update.php" method="post">
<input class="search" type="submit" id="submit" value="Confirm" onclick="checkPswd();" style="font-size px; width: 30%; height: 50px;">
</form>
</center>
<script type="text/javascript">
function checkPswd() {
var confirmPassword = "dltmaster2129";
var password = document.getElementById("password").value;
if (password == confirmPassword) {
alert("Update Data Successfully");
}
else{
alert("Passwords do not match.");
}
}
</script>
</body>
</html>
<?php
$str_var = $_GET["mvehicle"];
$array_var = unserialize(base64_decode($str_var));
//var_dump($array_var);
$link = mysqli_connect("192.168.10.7", "dlt", "dlt123", "DLT");
if($link === false){
die("ERROR: Could not connect. " . mysqli_connect_error());
}
$sql1 = "UPDATE mastertest SET active='0' WHERE unit_id_27='".$_GET['unit_id_27']."'";
$sql2 = "INSERT INTO mastertest (unit_id_27, active, model, unit_id, imei, vehicle_model, chassis, plate_no, reg_type, dlt_ver, cr, province, customer,last_update_to_DLT, registered_at, note_1, note_2)
VALUES ('".$array_var["unit_id_27"]."', '".$array_var["active"]."', '".$array_var["model"]."', '".$array_var["unit_id"]."', '".$array_var["imei"]."', '".$array_var["vehicle_model"]."',
'".$array_var["chassis"]."', '".$array_var["plate_no"]."', '".$array_var["reg_type"]."', '".$array_var["dlt_ver"]."', '".$array_var["cr"]."', '".$array_var["province"]."', '".$array_var["customer"]."',
'".$array_var["last_update_to_DLT"]."', '".$array_var["registered_at"]."', '".$array_var["note_1"]."', '".$array_var["note_2"]."')";
mysqli_close($link);
?>
--------------------------------------------------------------------------------------------------------
Tag : PHP
|
|
|
|
|
|
Date :
2018-10-01 18:06:49 |
By :
top8891 |
View :
636 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ก็เปิดช่องกรอกมาอีกอันเท่านั้น แหล่ะครับ
|
|
|
|
|
Date :
2018-10-01 18:26:00 |
By :
Chaidhanan |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|