login  Naam:   Wachtwoord: 
Registreer je!
 Forum

ledensysteempje

Offline David_VD - 16/04/2005 20:16
Avatar van David_VDLid ik heb een ledensysteem van op sitemasters, maar het werkt niet , ik weet niet waar de fout zit, kan iemand mij helpen:?: 
er zit ergens een fout want normaal moet hij naar david1.php gaan als je succesvol ingelogd bent 

dit is de pagina die alles nagaat of het wel klopt de gegevens.
  1. <?
  2. header("Pragma: ");
  3. header("Cache-Control: ");
  4. header("Expires: Mon, 26 Jul 1980 05:00:00 GMT");
  5. header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
  6. header("Cache-Control: no-store, no-cache, must-revalidate, proxy-revalidate");
  7. header("Cache-Control: post-check=0, pre-check=0", false);
  8. //set global variables
  9. global $username,$password;
  10.  
  11. //header("Pragma: no-cache");
  12. // EDIT HERE TO SUIT YOUR NEEDS
  13. //set usernames and passwords
  14. //only letters and numbers (no spaces) Known as can contain spaces
  15. $uname[1] = "daffy115admin";
  16. $upass[1] = "david115";
  17. $known_as[1] = "administrator";
  18. //additional users can be added
  19. //$uname[2] = "demo";
  20. //$upass[2] = "demo";
  21. //$known_as[2] = "demo";
  22.  
  23. //the login page
  24. $login_page = "index.php";
  25. //where to go after login
  26. $success_page = "david1.php";
  27. //the path to validate.php
  28. $validate_path = "full path to validate.php";
  29. //login failed error message
  30. $login_err = '<div align="center">Your User Name or Password was incorrect</b></div>';
  31. //no fields filled in
  32. $empty_err = '<div align="center"><b>You need to login with your User Name and Password</b></div>';
  33. //something entered that wasn't a letter or number error message
  34. $chr_err = '<div align="center"><b>Please retry</b></div>';
  35. // DO NOT EDIT BELOW HERE
  36.  
  37. //if the form is empty and the cookie isn't set
  38. //then display error message the return to login
  39. if($username == "" && $password == "" && !isset($_COOKIE["this_cookie"])){
  40. print($empty_err);
  41. include($login_page);
  42. exit();
  43. }
  44.  
  45. //if the form is not empty and the cookie isn't set
  46. //then make sure that only letters and numbers are entered
  47. //if there are then display error message the return to login
  48. if($username != "" || $password != "" && !isset($_COOKIE["this_cookie"])){
  49. if (preg_match ("/[^a-zA-Z0-9]/", $username.$password)){
  50. print($chr_err);
  51. include($login_page);
  52. exit();
  53. }
  54. }
  55.  
  56. //if the cookie isn't set
  57. if (!isset($_COOKIE["this_cookie"]) ){
  58. $user_count = count($uname);
  59. $user_exists = false;
  60.  
  61. // check through all the users to see if they exist
  62. for ($i = 1; $i <= $user_count; $i++) {
  63. if ($uname[$i] == $username && $upass[$i] == $password){
  64. $user_id=$i;
  65. //$welcome_name = $known_as[$i];
  66. $user_exists = true;
  67. }
  68. }
  69.  
  70. if(!$user_exists){
  71. print ($login_err);
  72. include($login_page);
  73. exit();
  74. }
  75.  
  76. //if the login is correct then set the cookie
  77. $cookie_val=crypt($uname[$user_id]);
  78. //set the cookie so it dies when the browser is closed
  79. setcookie ("name", $known_as[$user_id], 0);
  80. setcookie ("this_cookie", $cookie_val, 0);
  81. header("Location: $success_page");
  82. exit();
  83. }
  84.  
  85. //if a user tries to access validate.php directly and they are logged in
  86. if($REQUEST_URI == $validate_path){
  87. echo "<html>\n<head>\n";
  88. echo "<title>Yor are logged in</title>\n";
  89. echo "</head>\n";
  90. echo "<body bgcolor=\"white\">\n";
  91. echo "You are logged in. <a href=\"".$success_page."\">Continue</a>\n";
  92. echo "</body>\n";
  93. echo "</html>\n";
  94.  
  95. }
  96.  
  97. ?>

en dit is de login pagina
  1. <html>
  2. <head>
  3. <title>Login Page</title>
  4. </head>
  5. <body background="http://daffy115.devlinderboom.be/daffy115.tk/daffy115.tk achtergrond.jpg">
  6. <table width="400" align="center">
  7. <tr>
  8. <th valign=top><font color="#ffffff"> private area </th>
  9. </tr>
  10. <tr>
  11. <td>
  12. <font color="#ffffff"><p>This is a private area. </p>
  13. <p>Please log in below if you have access to this area </p>
  14. <?
  15. //if no cookie is set then display the form
  16. if(!isset($_COOKIE["this_cookie"])){
  17. echo '<div align="center"><form action="validate.php" method="post">';
  18. echo 'username : <input type="text" name="username"><br><br>';
  19. echo 'password : <input type="password" name="password"><br><br>';
  20. echo '<input type="submit" value="login"></form></div>';
  21. }else{
  22. echo "You are already logged in. <a href=\"1.php\">Continue</a>";
  23. }
  24. ?>
  25. </td>
  26. </tr>
  27. </table>
  28. </font>
  29. </body>
  30. </html>


wie kan mij helpen?

5 antwoorden

Gesponsorde links
Offline Mokka - 16/04/2005 20:25
Avatar van Mokka Onbekend welk script is het? geef de link eens, zonder kun je lastig werken!:p
Offline David_VD - 16/04/2005 20:34 (laatste wijziging 16/04/2005 20:35)
Avatar van David_VD Lid http://www.site...amp;id=508
dit is de link, bedank dat je eens wil kijken 
Offline Mokka - 16/04/2005 20:38 (laatste wijziging 16/04/2005 20:39)
Avatar van Mokka Onbekend volgens mij ben je 2 totaal verschillende scripts, beide van een andere pagina door elkaar aan het gebruiken, heb je het bovenstaande script wel zelf gemaakt?

trouwens, waarom gebruik je dat ledensysteem, ik vind dat persoonlijk het meest moeilijk gemaakt script dat er bij de grote systemen staat... -.-' maar dat kan aan mij liggen:D
Offline David_VD - 16/04/2005 20:39
Avatar van David_VD Lid neen, die staan in een zip file als je ze download
Offline Rens - 17/04/2005 12:28
Avatar van Rens Gouden medaille

Crew algemeen
regel 22 van de login pagina.
Daar staat 1.php, dat moet dan denk ik david1.php worden...
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.19s