Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //FORM
- <input type="text" value="<?php echo $b['nis']; ?>" class="form-control" name="pass"
- <input type="text" value="<?php echo $b['id_siswa']; ?>" class="form-control" name="id" >
- <input type="submit" onclick="return confirm('Reset Password ?')"; name="reset" value="Reset" class="btn btn-warning ">
- </td>
- </tr>
- </table>
- <?php
- if (isset($_POST['reset'])) {
- $siswa->reset($_POST['pass'],$_POST['id']);
- //echo "<script>alert('Password Telah Direset');</script>";
- print_r($_POST);
- }
- ?>
- //CLASS
- class siswa
- {
- function reset($pass,$id)
- {
- $pass = md5($pass);
- mysql_query("UPDATE siswa SET password = '$pass' WHERE id_siswa='$id' ");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement