Advertisement
Guest User

Untitled

a guest
Aug 2nd, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. //FORM
  2. <input type="text" value="<?php echo $b['nis']; ?>" class="form-control" name="pass"
  3. <input type="text" value="<?php echo $b['id_siswa']; ?>" class="form-control" name="id" >
  4. <input type="submit" onclick="return confirm('Reset Password ?')"; name="reset" value="Reset" class="btn btn-warning ">
  5. </td>
  6. </tr>
  7. </table>
  8. <?php
  9. if (isset($_POST['reset'])) {
  10. $siswa->reset($_POST['pass'],$_POST['id']);
  11. //echo "<script>alert('Password Telah Direset');</script>";
  12. print_r($_POST);
  13. }
  14. ?>
  15.  
  16. //CLASS
  17. class siswa
  18. {
  19. function reset($pass,$id)
  20. {
  21. $pass = md5($pass);
  22. mysql_query("UPDATE siswa SET password = '$pass' WHERE id_siswa='$id' ");
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement