CMS ultra léger au style oldschool, projet de la communauté Kalaïn Hundin.

profile2.php 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?php session_start(); ?>
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. </head>
  6. <body>
  7. <center>
  8. <section>
  9. <?php
  10. require_once('config.php');
  11. require_once('verifications.php');
  12. $page_name='Profile Modification';
  13. include_once('top.php');
  14. //récupération du formulaire
  15. $email=formulaires($_POST['email']);
  16. $pass_enc=formulaires($_POST['pass_enc']);
  17. $new_pass=formulaires($_POST['new_pass']);
  18. $new_pass2=formulaires($_POST['new_pass2']);
  19. if(!$email)
  20. {
  21. ?>
  22. E-mail inexisant.<br /><a href='profile.php' onClick='history.back()'>Back</a>
  23. </section>
  24. </center>
  25. </body>
  26. </html>
  27. <?php
  28. include_once('bottom.php');
  29. return FALSE;
  30. }
  31. if(isset($pass_enc))
  32. {
  33. if(!$new_pass || !$new_pass2 || strlen($new_pass) < 5)
  34. {
  35. ?>
  36. Your password or its confirmation is inexistant or your password is less than 5 characters<br /><a href="profile.php" onClick="history.back()">Back</a>
  37. </section>
  38. </center>
  39. </body>
  40. </html>
  41. <?php
  42. include_once('bottom.php');
  43. return FALSE;
  44. }
  45. if($new_pass!=$new_pass2)
  46. {
  47. ?>
  48. Passwords don't match !<br /><a href="profile.php" onClick="history.back()">Back</a>
  49. </section>
  50. </center>
  51. </body>
  52. </html>
  53. <?php
  54. include_once('bottom.php');
  55. return FALSE;
  56. }
  57. $pass_enc=md5($pass_enc);
  58. $reponse_pass=mysql_query("SELECT pass FROM user WHERE pass='$pass_enc' AND session='$session'") or die ('error : '.mysql_error()); //verification si mot de passe valide
  59. $count_pass=mysql_num_rows($reponse_pass);
  60. if($count_pass == 0)
  61. {
  62. ?>
  63. The old password is not correct.<br /><a href="profile.php" onClick="history.back()">Back</a>
  64. </section>
  65. </center>
  66. </body>
  67. </html>
  68. <?php
  69. include_once('bottom.php');
  70. return FALSE;
  71. }
  72. $new_pass=md5($new_pass);
  73. mysql_query("UPDATE user SET pass='$new_pass' WHERE session='$session'") or die ('error : '.mysql_error());
  74. }
  75. mysql_query("UPDATE user SET email='$email' WHERE session='$session'") or die ('error : '.mysql_error());
  76. echo"<div align=center>Your profile settings have been saved.<br /><a href='profile.php' onClick='history.back()'>Back</a></div>";
  77. include_once('bottom.php');
  78. ?>
  79. </section>
  80. </center>
  81. </body>
  82. </html>