doUser.php 783 B

12345678910111213141516171819
  1. <?php
  2. $id = $_POST["id"];
  3. $user = $_POST['user'];
  4. $pwd = $_POST['password'];
  5. $token = $_POST['token'];
  6. $salt = 'make';
  7. $hashedToken = md5($token . $salt);
  8. include_once("../../untils/conn.php");
  9. if ($con) {
  10. mysqli_query($con, "set names utf8");
  11. $data = $con->query("UPDATE admin SET user ='" . $user . "',password='" . $pwd . "', token='" . $hashedToken . "'where id=" . $id);
  12. if ($data > 0) {
  13. echo "<script>alert('修改信息成功');window.location.replace(document.referrer)</script> ";
  14. } else {
  15. echo ("<script>alert('修改失败');window.location.replace(document.referrer)</script>");
  16. }
  17. }
  18. $con->close();
  19. ?>