| Server IP : 27.254.96.235 / Your IP : 216.73.216.44 Web Server : Apache/2 System : Linux cs95 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64 User : piboonsa ( 1055) PHP Version : 8.0.30 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/piboonsa/domains/piboonsawasdee.ac.th/public_html/backend/ |
Upload File : |
<?php
include("passlog.inc.php");
include("lib/config.php");
$notic = "";
if($_POST['change'] == "yes"){
$newpw = $_POST['newpw'];
$cfpw = $_POST['cfpw'];
$curpw = $_POST['curpw'];
if($newpw != $cfpw){
$notice = '<span class="red">รหัสผ่านใหม่ไม่ตรงกัน!!!</span>';
$change = "no";
}else{
$query = $db->query("SELECT * FROM account WHERE username = '".$_SESSION['username']."' AND password = password('$curpw')");
if($db->getcountrow($query) == 0){
$notice = '<span class="red">รหัสผ่านปัจจุบันไม่ถูกต้อง</span>';
$change = "no";
}else{
$db->query("UPDATE account SET password = password('$newpw') WHERE username = '".$_SESSION['username']."'");
$notice = '<span class="green">เปลี่ยนรหัสผ่านเรียบร้อย</span>';
$change = "no";
}
}
}
?>
<!DOCTYPE HTML>
<html>
<head>
<?php include("top.inc.php");?>
</head>
<body class="theme-blue">
<?php
include("head.inc.php");
include("leftside.inc.php");
?>
<div class="content">
<div class="header">
<h1 class="page-title">เปลี่ยนรหัสผ่าน</h1>
<ul class="breadcrumb">
<li><a href="main.php">หน้าแรก</a> </li>
<li class="active">เปลี่ยนรหัสผ่าน</li>
</ul>
</div>
<div class="main-content">
<div class="dialog">
<div class="panel panel-default">
<p class="panel-heading no-collapse">เปลี่ยนรหัสผ่าน</p>
<div class="panel-body">
<form id="form1" name="form1" method="post" action="">
<span class="red"><?=$notice?></span>
<div class="form-group">
<label>รหัสผ่านใหม่ <span class="red">*</span></label>
<input name="newpw" type="password" class="form-controlspan12 form-control" id="newpw">
</div>
<div class="form-group">
<label>ยืนยันรหัสผ่านใหม่ <span class="red">*</span></label>
<input name="cfpw" type="password" class="form-controlspan12 form-control" id="cfpw">
</div>
<div class="form-group">
<label>รหัสผ่านปัจจุบัน<span class="red">*</span></label>
<input name="curpw" type="password" class="form-controlspan12 form-control" id="curpw">
</div>
<input name="change" type="hidden" value="yes">
<input type="submit" name="button" id="button" value="เปลี่ยนรหัสผ่าน" class="btn btn-primary pull-right">
<div class="clearfix"></div>
</form>
</div>
</div>
</div>
<?php include("foot.inc.php");?>
</div>
</div>
</body>
</html>