repwd.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?
  2. include("../config/conn.php");
  3. include("../config/function.php");
  4. if($_GET["chk"]!=sha1($_GET[id].weburl)){php_toheader("../");}
  5. $id=$_GET[id];
  6. $tmp=$_GET[tmp];
  7. if(!preg_match("/^[_a-zA-Z0-9.@]*$/",$tmp) || empty($tmp)){Audit_alert("非法来源!","../");}
  8. while0("id,uid,getpwd","yjcode_user where id=".$id." and getpwd='".$tmp."'");if(!$row=mysql_fetch_array($res)){Audit_alert("路径错误!","getpasswd.php");}
  9. $uid=$row[uid];
  10. if(sqlzhuru($_POST[jvs])=="repwd"){
  11. zwzr();
  12. $pwd=sha1(sqlzhuru($_POST[t1]));
  13. $y=time().rnd_num(100);
  14. updatetable("yjcode_user","pwd='".$pwd."',getpwd=''where id=".$id." and getpwd='".$tmp."'");
  15. $_SESSION["SHOPUSER"]=$uid;
  16. php_toheader("../user/");
  17. }
  18. ?>
  19. <html>
  20. <head>
  21. <meta http-equiv="x-ua-compatible" content="ie=7" />
  22. <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
  23. <title>找回密码 - <?=webname?></title>
  24. <? include("../tem/cssjs.html");?>
  25. </head>
  26. <body>
  27. <? include("../tem/top.html");?>
  28. <? include("../tem/top1.html");?>
  29. <div class="yjcode">
  30. <div class="getpassword">
  31. <ul class="u1">
  32. <li class="l1">重设密码</li>
  33. <li class="l2"></li>
  34. </ul>
  35. </div>
  36. <div class="getpwdmain">
  37. <form name="f1" method="post" onSubmit="return repwdtj(<?=$_GET[id]?>,'<?=$_GET[chk]?>','<?=$_GET[tmp]?>')">
  38. <ul class="u1">
  39. <li class="l1">帐号:</li>
  40. <li class="l2"><input value="<?=$uid?>" readonly class="inp" type="text" style="width:184px;" /></li>
  41. <li class="l3"></li>
  42. </ul>
  43. <ul class="u1">
  44. <li class="l1">输入新密码:</li>
  45. <li class="l2"><input name="t1" class="inp" type="password" style="width:184px;" /></li>
  46. <li class="l3"></li>
  47. </ul>
  48. <ul class="u1">
  49. <li class="l1">重复新密码:</li>
  50. <li class="l2"><input name="t2" class="inp" type="password" style="width:184px;" /></li>
  51. <li class="l3"></li>
  52. </ul>
  53. <ul class="u1">
  54. <li class="l1"></li>
  55. <li class="l2"><? tjbtnr("提交保存");?></li>
  56. <li class="l3"></li>
  57. </ul>
  58. <input type="hidden" value="repwd" name="jvs" />
  59. </form>
  60. </div>
  61. </div>
  62. <? include("../tem/bottom.html");?>
  63. </body>
  64. </html>