login  Naam:   Wachtwoord: 
Registreer je!
 Forum

Registratie (Opgelost)

Offline Sar - 30/06/2007 13:44 (laatste wijziging 30/06/2007 16:43)
Avatar van SarPHP interesse Hey,

Ik ben bezig met een klein registratie systeem, ik heb nu dit:

register.php
  1. <?php
  2. if($_SERVER['REQUEST_METHOD'] == 'POST' && !empty($_POST))
  3. {
  4. $name = $_POST['name'];
  5. $user = mysql_query("SELECT * FROM users WHERE name='".$name."'") or die(mysql_error());
  6. $afouten = array();
  7. if(trim($_POST['name']) == '')
  8. {
  9. echo $user_forgot;
  10. }
  11. if(trim($_POST['pass']) == '')
  12. {
  13. echo $pass_forgot;
  14. }
  15. if(mb_strlen($_POST['name']) < '2')
  16. {
  17. echo $user_short;
  18. {
  19. if(mb_strlen($_POST['pass']) < '5')
  20. {
  21. echo $pass_short;
  22. }
  23. if(mysql_num_rows($user) > '0')
  24. {
  25. echo $user_exist;
  26. }
  27. if(strcmp($_POST['pass'], $_POST['pass2']))
  28. {
  29. echo $pass_notsame;
  30. }
  31.  
  32. if(count($afouten) != 0)
  33. {
  34. echo $fouten."<p>";
  35. for($fi = 0; $fi < count($afouten); $fi++)
  36. {
  37. echo $afouten[$fi]."<p>";
  38. }
  39. echo $back;
  40. }
  41. else
  42. {
  43. $pass = md5($_POST['pass']);
  44. $level = 1;
  45. mysql_query("INSERT INTO users(name, pass, level) VALUES ('".addslashes($name)."', '".addslashes($pass)."', '".addslashes($level)."')") or die(mysql_error());
  46.  
  47. echo $voltooid;
  48. }
  49. }
  50. else //Hier geeft ie nu aan unexpected T_ELSE
  51. {
  52. ?>
  53.  
  54. <form method="post" action="?p=register.php">
  55. <table>
  56. <tr>
  57. <td><?php echo $user; ?></td> <td><input type="text" name="name" size="40" maxlength="20" /></td>
  58. </tr>
  59.  
  60. <tr>
  61. <td><?php echo $password; ?></td> <td><input type="password" name="pass" size="40" maxlength="30" /></td>
  62. </tr>
  63.  
  64. <tr>
  65. <td><?php echo $password2; ?></td> <td><input type="password" name="pass2" size="40" maxlength="30" /></td>
  66. </tr>
  67.  
  68. <tr>
  69. <td colspan="2"><center><input type="submit" name="submit" value="submit" /></center></td>
  70. </tr>
  71. </table>
  72. </form>
  73.  
  74. <?php
  75. }
  76. ?>


Weet iemand wat er fout is?

0 antwoorden

Gesponsorde links
Er zijn nog geen reacties op dit bericht.
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.197s