Просмотр файла city1/profile.php

Размер файла: 3.7Kb
  1. <?php
  2. include "ini.php";
  3. include "includes/header.php";
  4. include "includes/inc_online.php";
  5. print "<p><small>";
  6.  
  7. $id=cyr(htmlspecialchars(stripslashes(trim($id))));
  8. $login=cyr(htmlspecialchars(stripslashes(trim($login))));
  9. $pass=cyr(htmlspecialchars(stripslashes(trim($pass))));
  10.  
  11. if(!empty($login))
  12. {
  13. $q = mysql_query("select pass,id,login,mobile,about,email from users where login='".cyr($login)."';");
  14. }
  15. elseif(!empty($id))
  16. {
  17. $q = mysql_query("select pass,id,login,mobile,about,email from users where id='".$id."';");
  18. }
  19. else
  20. {
  21. die ($lang['empty_login']."</small></p></card></wml>");
  22. }
  23.  
  24. $data = mysql_fetch_array($q);
  25.  
  26. $id=$data['id'];
  27. $login=$data['login'];
  28. $mobile=$data['mobile'];
  29. $about=$data['about'];
  30. $mail=$data['email'];
  31.  
  32. if($pass!=$data['pass'])
  33. {
  34. die ($lang['empty_login']."</small></p></card></wml>");
  35. }
  36.  
  37. mysql_query("update users set last='".time()."',city='0' where id='".$id."';");
  38.  
  39.  
  40. switch ($mode)
  41. {
  42. case "save":
  43.  
  44. if($newpass!=$newpass2)
  45. {
  46. print $lang['reg_error_pass']."<br/>";
  47. print "<anchor>".$lang['again']."<prev/></anchor></small></p></card></wml>";
  48. exit;
  49. }
  50. if (ereg("[а-яА-Я,$,>,<,',;,/,\,&,#,,,.,:,*,@,!,%,^,(,)]","$newpass$login$newpass2"))
  51. {
  52. print $lang['reg_bad_symbols']."<br/>";
  53. print "<anchor>".$lang['again']."<prev/></anchor></small></p></card></wml>";
  54. exit;
  55. }
  56.  
  57. $newpass=cyr(htmlspecialchars(stripslashes(trim(str_replace('$','$$',$newpass)))));
  58. $newpass2=cyr(htmlspecialchars(stripslashes(trim(str_replace('$','$$',$newpass2)))));
  59. $newemail=cyr(htmlspecialchars(stripslashes(trim(str_replace('$','$$',$newemail)))));
  60. $newmobile=cyr(htmlspecialchars(stripslashes(trim(str_replace('$','$$',$newmobile)))));
  61. $newabout=cyr(htmlspecialchars(stripslashes(trim(str_replace('$','$$',$newabout)))));
  62. $newnums=cyr(htmlspecialchars(stripslashes(trim(str_replace('$','$$',$newnums)))));
  63.  
  64. mysql_query("update users set pass='".$newpass."',email='".$newemail."',mobile='".$newmobile."',about='".$newabout."',nums='".$newnums."' where id='".$id."';");
  65. print $lang['profile_refreshed'];
  66.  
  67. $pass=$newpass;
  68.  
  69. break;
  70. default:
  71. print $lang['profile_pass'].":</small><br/>";
  72. print "<input name=\"newpass\" value=\"$pass\" maxlength=\"15\"/><br/>";
  73. print "<small>".$lang['profile_pass2'].":</small><br/>";
  74. print "<input name=\"newpass2\" value=\"$pass\" maxlength=\"15\"/><br/>";
  75. print "<small>".$lang['reg_mail'].":</small><br/>";
  76. print "<input name=\"newemail\" value=\"$mail\"/><br/>";
  77. print "<small>".$lang['regmobile'].":</small><br/>";
  78. print "<input value=\"$mobile\" name=\"newmobile\"/><br/>";
  79.  
  80. print "<small>".$lang['regabout'].":</small><br/>";
  81. print "<input value=\"$about\" name=\"newabout\"/><br/>";
  82. print "<small>".$lang['regonline'].":</small><br/>";
  83. print "<select name=\"newnums\">
  84. <option value=\"5\">5</option>
  85. <option value=\"10\">10</option>
  86. <option value=\"15\">15</option>
  87. <option value=\"20\">20</option>
  88. <option value=\"25\">25</option>
  89. <option value=\"30\">30</option>
  90. <option value=\"50\">50</option>
  91. </select><br/>";
  92. print "<small><anchor>".$lang['ok']."
  93. <go href=\"profile.php?id=$id&amp;pass=$pass\" method=\"post\">
  94. <postfield name=\"mode\" value=\"save\"/>
  95. <postfield name=\"newpass\" value=\"$(newpass)\"/>
  96. <postfield name=\"newpass2\" value=\"$(newpass2)\"/>
  97. <postfield name=\"newemail\" value=\"$(newemail)\"/>
  98. <postfield name=\"newmobile\" value=\"$(newmobile)\"/>
  99. <postfield name=\"newstatus\" value=\"$(newstatus)\"/>
  100. <postfield name=\"newabout\" value=\"$(newabout)\"/>
  101. <postfield name=\"newnums\" value=\"$(newnums)\"/>
  102. </go>
  103. </anchor>";
  104. break;
  105. }
  106.  
  107.  
  108. print "<br/><a href=\"game.php?id=$id&amp;pass=$pass\">".$lang['menu']."</a>";
  109. print "<br/>---";
  110.  
  111. mysql_close();
  112. print "</small></p></card></wml>";
  113. ?>