Просмотр файла eforum25/fgtnp.php

Размер файла: 1.57Kb
  1. <?php
  2. include "config.php";
  3. include "incl/head.inc";
  4.  
  5. $temp_var=0;$new_pass='';
  6.  
  7. $alphabet="abcdefghijklmnopqrstuvwxyz1234567890";
  8. for($i=0;$i<6;$i++){$new_pass.=$alphabet[(mt_rand(0,(strlen($alphabet)-1)))];}
  9.  
  10. if(isset($mail)&&$mail!=''){
  11. $mail=strtolower($mail);
  12.  
  13. $fs=open_file($members_file);
  14. $fs=explode("\n",$fs);
  15.  
  16. for($i=1;$i<count($fs);$i++){
  17. if(strlen($fs[$i])>9){
  18. $row=explode(":|:",$fs[$i]);
  19. if(strtolower($row[2])==$mail){
  20. $row[1]=md5($new_pass);
  21. $user=$row[0];
  22. if(!isset($row[5])){$row[5]='m';}
  23.  
  24. $fs[$i]=implode(":|:",$row);
  25. $temp_var=1;break;}}}}
  26.  
  27. if($temp_var==1){
  28. $fs=implode("\n",$fs);
  29. save_file($members_file,$fs,0);
  30. mail($mail,"...","user:$user\npassword:$new_pass","From: admin@$SERVER_NAME");
  31. die("<title>...</title></head><body><span class=\"w\">$lang[65]</span></body></html>");}
  32.  
  33. ?><title>...</title></head><body><form name="y" action="fgtnp.php" method="post">
  34. <table width="280" border="0" cellpadding="0" cellspacing="0" align="center"><tr><td class="q">
  35. <table width="100%" border="0" cellspacing="1" cellpadding="5">
  36. <tr class="c"><td><table width="100%" cellpadding="1" cellspacing="0"><tr><td nowrap="nowrap"><span class="c"><?php print $lang[61];?></span></td></tr></table></td></tr>
  37. <tr class="a"><td><table><tr><td width="50" nowrap="nowrap"><b><?php print $lang[57];?>:</b></td>
  38. <td width="180"><input size="25" type="text" name="mail" class="ia" maxlength="30" value="" /></td>
  39. <td width="50"><input type="submit" value="<?php print $lang[3];?>" class="ib" /></td>
  40. </tr></table></td></tr></table></td></tr></table></form></body></html>