Server IP : 103.6.199.200 / Your IP : 3.135.184.195 Web Server : Microsoft-IIS/10.0 System : Windows NT EMPUSA 10.0 build 20348 (Windows Server 2016) i586 User : EMPUSA$ ( 0) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/Domains/smsmalor/smsmalorsetar.com/wwwroot/ |
Upload File : |
<?php require_once('Connections/mentorpbs.php'); ?> <?php if (!isset($_SESSION)) { session_start(); } $MM_authorizedUsers = ""; $MM_donotCheckaccess = "true"; ?> <?php $colname_Recordset_cpw = "-1"; if (isset($_SESSION['MM_Password'])) { $colname_Recordset_cpw = $_SESSION['MM_Password']; } mysqli_select_db($mentorpbs,$database_mentorpbs); $query_Recordset_cpw = "SELECT * FROM login_bidang WHERE password='$colname_Recordset_cpw'"; $Recordset_cpw = mysqli_query($mentorpbs,$query_Recordset_cpw) or die(mysqli_error()); $row_Recordset_cpw = mysqli_fetch_assoc($Recordset_cpw); $totalRows_Recordset_cpw = mysqli_num_rows($Recordset_cpw); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <!-- **************************** --> <?php if (isset($_POST['btn_uploadpic'])) { if(isset($_FILES['myfile'])) { $errors = array(); $maxsize = 300000; $acceptable = array( #'application/pdf', 'image/jpeg', 'image/jpg', 'image/gif', 'image/png' ); if(($_FILES['myfile']['size'] >= $maxsize) || ($_FILES["myfile"]["size"] == 0)) { $errors[] = 'File too large. File must be less than 2 megabytes.'; } if((!in_array($_FILES['myfile']['type'], $acceptable)) && (!empty($_FILES["myfile"]["type"]))) { $errors[] = 'Invalid file type. Only PDF, JPG, GIF and PNG types are accepted.'; } if(count($errors) === 0) { $id=$_POST['hf_nama']; $myid=strval($id); move_uploaded_file($_FILES["myfile"]["tmp_name"],"images/login_photo/".$myid.".jpg"); } else { foreach($errors as $error) { echo '<script>alert("'.$error.'"); </script>'; } echo "<script> window.location.back(); //Ensure no more processing is done </script>"; } } } ?> <!-- **************************** --> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> <!-- .style1 { font-size: 24px; color: #0000FF; } .header { padding: 0px 0px; } .content { padding: 16px; } .sticky { position: fixed; top: 0; width: 100%; } .sticky + .content { padding-top: 102px; } --> </style> </head> <body> <!-- ***** bind header to freeze id --> <div class="header" id="myHeader"> <?php include('smheader02_tkl.php') ?> </div> <!-- ***** Kandungan akan skrol --> <div class="content"> <div align="center" class="style1">MENUKAR KATA LALUAN<br /> LOGIN KE MAKLUMAT BIDANG </div> <p> </p> <!-- *************************** --> <p align="center"> <img src="images/login_photo/<?php echo $_SESSION['MM_Username']; ?>.jpg" alt="" width="138" height="169" /> </p> <table width="371" border="0" align="center"> <tr> <td> <div align="center"> <form action="" method="post" enctype="multipart/form-data" name="form2" id="form2"> <label> <input type="file" name="myfile" id="myfile" /> <input type="submit" name="btn_uploadpic" id="btn_uploadpic" value="Upload Gambar jpg < 300 kb" /> </label> <input name="hf_nama" type="hidden" id="hf_nama" value="<?php echo $_SESSION['MM_Username']; ?>" /> </form> </div> </td> </tr> </table> <!-- *************************** --> <p align="center"> </p> <form action='' method="post" name="form1" id="form1"> <table align="center"> <tr valign="baseline"> <td nowrap="nowrap" align="right">Username:</td> <td><?php echo $_SESSION['MM_Username']; ?></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right">Kata Laluan Lama:</td> <td><?php echo $_SESSION['MM_Password']; ?></td> </tr> <tr valign="baseline"> <td nowrap="nowrap" align="right"> Kata Laluan Baru (alpha-numeric or symbol max 12 digits / chrs): </td> <td> <input type="text" name="katalaluan_baru"> </td> </tr> <tr></tr> <tr></tr> <tr></tr> <tr valign="baseline"> <td colspan="2" align="right" nowrap="nowrap"> <div align="center"> <input type="submit" name="btn_upd_pw" value="KEMAS KINI" /> </div> </td> </tr> </table> <input type="hidden" name="myid" value="<?php echo $row_Recordset_cpw['guna_id']; ?>" /> <input type="hidden" name="MM_update" value="form1" /> <!-- ambiguious code repeat for guna_id hidden textbox --> </form> <p> </p> </div> <!-- Skrol kandungan --> </body> <!-- Script to execute freeze --> <script> window.onscroll = function() {myFunction()}; var header = document.getElementById("myHeader"); var sticky = header.offsetTop; function myFunction() { if (window.pageYOffset > sticky) { header.classList.add("sticky"); } else { header.classList.remove("sticky"); } } </script> </html> <?php # menyemak kewujudan data POST if(!empty($_POST['btn_upd_pw'])) { # mengambil data POST $mykatalaluan=$_POST['katalaluan_baru']; $idsaya=$_POST['myid']; # arahan untuk kemaskini mysqli_select_db($mentorpbs,$database_mentorpbs); $arahan_sql_update="update login_bidang set password='$mykatalaluan' where guna_id='$idsaya'"; #melaksanakan proses kemaskini bersyarat if(mysqli_query($mentorpbs,$arahan_sql_update)) { # proses kemaskini berjaya echo "<script>alert('Kemaskini Berjaya'); window.location.href='login_cpw_maklumat.php'; </script>"; } else { # proses kemaskini gagal echo "<script>.alert('Kemaskini gagal'); window.location.href='logout_cpwb.php'; </script>"; } } ?>