login  Naam:   Wachtwoord: 
Registreer je!
 Forum

inlog probleem

Offline ottorocket - 28/12/2005 21:10 (laatste wijziging 28/12/2005 21:42)
Avatar van ottorocketOnbekend het probleem met de login is opgelost
maar nu staat hier een fout op lijn 88

  1. Parse error: parse error, unexpected T_STRING in /home2/mats/public_html/counter-terrors/login.php on line 88


  1. <?php /* ------------------------- */
  2.  
  3. include("_include-config.php");
  4.  
  5. if(isset($_POST['login'],$_POST['pass'])) {
  6. $dbres = mysql_query("SELECT `login`,`activated` FROM `[users]` WHERE `login`='{$_POST['login']}' AND `pass`=MD5('{$_POST['pass']}')");
  7. if(($data = mysql_fetch_object($dbres)) && $data->activated == 1) {
  8. $validate = md5(rand(0,1000));
  9. setcookie("login",$data->login,time()+60*60*24,"/",".crimewar2004.com");
  10. setcookie("validate",$validate,time()+60*60*24,"/",".crimewar2004.com");
  11. mysql_query("REPLACE INTO `[online]`(`time`,`login`,`IP`,`validate`) values(NOW(),'{$_SERVER['REMOTE_ADDR']}','{$data->login}','$validate')");
  12. $_SESSION['login'] = $data->login;
  13. $_SESSION['IP'] = $_SERVER['REMOTE_ADDR'];
  14. $dbres = mysql_query("SELECT *,UNIX_TIMESTAMP(`signup`) AS `signup` FROM `[users]` WHERE `login`='{$_SESSION['login']}'");
  15. $_SESSION['data'] = mysql_fetch_object($dbres);
  16. }
  17. }
  18. else if($_GET['x'] == "logout") {
  19. mysql_query("DELETE FROM `[online]` WHERE `login`='{$_COOKIE['login']}' AND `validate`='{$_COOKIE['validate']}' AND `IP`='{$_SERVER['REMOTE_ADDR']}'");
  20. setcookie("login",'',time()-24*60*60,"/","");
  21. setcookie("validate",'',time()-24*60*60,"/","");
  22. unset($_SESSION['login']);
  23. unset($_SESSION['IP']);
  24. unset($_SESSION['data']);
  25. }
  26.  
  27.  
  28. /* ------------------------- */ ?>
  29. <html>
  30.  
  31.  
  32. <head>
  33. <title><--counter terrors--></title>
  34. <link rel="stylesheet" type="text/css" href="<?php echo ($_COOKIE['v'] == 2) ? "css-v2.css" : "css-v1.css"; ?>">
  35.  
  36. </head>
  37.  
  38.  
  39. <body style="background: #996600; margin: 0px;">
  40. <table align="center" width=100%>
  41. <?php /* ------------------------- */
  42.  
  43. if($_GET['x'] == "logout")
  44. print " <tr><td class=\"subTitle\"><b>Login</b></td></tr>\n <tr><td class=\"mainTxt\">Je bent nu uitgelogd\n <script language=\"javascript\">setTimeout('parent.window.location.reload()',500)</script></td></tr>\n";
  45. else if($_GET['x'] == "lostpass") {
  46. print " <tr><td class=\"subTitle\"><b><center>Wachtwoord vergeten</center></b></td></tr>\n";
  47. if(isset($_GET['id'],$_GET['code'])) {
  48. $dbres = mysql_query("SELECT `login` FROM `[temp]` WHERE `id`='{$_GET['id']}' AND `code`='{$_GET['code']}' AND `area`='lostpass'");
  49. if($data = mysql_fetch_object($dbres)) {
  50. $dbres = mysql_query("SELECT `login`,`email` FROM `[users]` WHERE `login`='{$data->login}'");
  51. $data = mysql_fetch_object($dbres);
  52.  
  53. $newpass = rand(100000,999999);
  54. mysql_query("UPDATE `[users]` SET `pass`=MD5('$newpass') WHERE `login`='{$data->login}'");
  55. mysql_query("DELETE FROM `[temp]` WHERE `id`='{$_GET['id']}'");
  56. mail($data->email,"Criminals password","Je wachtwoord is gereset, je kan nu inloggen met: $newpass","From: Criminals <security@crimewar2004.com>\n");
  57. print " <tr><td class=\"mainTxt\">Je nieuwe wachtwoord is ge-emailed naar {$data->email}</td></tr>\n";
  58. }
  59. }
  60. else if(isset($_POST['email'],$_POST['login'])) {
  61. $dbres = mysql_query("SELECT `login`,`email` FROM `[users]` WHERE `login`='{$_POST['login']}' AND `email`='{$_POST['email']}'AND `activated`=1");
  62. if($data = mysql_fetch_object($dbres)) {
  63. $code = rand(100000,999999);
  64. mysql_query("INSERT INTO `[temp]`(`login`,`code`,`area`,`time`) values('{$data->login}',$code,'lostpass',NOW())");
  65. $id = mysql_insert_id();
  66. mail($data->email,"Criminals password","Er is een aanvraag binnengekomen om je wachtwoord te resetten. Als jij dit niet hebt aangevraagd, negeer deze email dan. Heb jij dit wel gedaan, klik dan op deze link:\nhttp://www.wyger.nl/usr/counter-terrors/index.php?x=lostpass&id=$id&code=$code","From: Criminals <security@crimewar2004.com>");
  67. print " <tr><td class=\"mainTxt\">Er is een email gestuurd naar {$data->email} met verdere instructies</td></tr>\n";
  68. }
  69. else
  70. print " <tr><td class=\"mainTxt\">Er is geen gebruiker met die login en e-mail</td></tr>\n";
  71. }
  72.  
  73. print <<<ENDHTML
  74.   <tr><td class="mainTxt" align="center">
  75. <center><img src="images/bliksem.gif"></center>
  76. <form method="post"><table>
  77. <tr><td width=100>Login:</td> <td><input type="text" name="login"></td></tr>
  78. <tr><td width=100>E-Mail:<td> <td><input type="text" name="email"></td></tr>
  79. <tr><td></td> <td align="right"><input type="submit" value="Ok" style="width: 100"></td></tr>
  80. </form></table></td></tr>
  81. ENDHTML;
  82. }
  83. else if($data) {
  84. if($data->activated == 0)
  85. print " <tr><td class=\"mainTxt\">Je account is nog niet geactiveerd</td></tr>\n";
  86. print " <tr><td class=\"subTitle\"><b>Login</b></td></tr>\n <tr><td class=\"mainTxt\"><center> Welkom $data->login,<br>
  87. Je bent succesvol ingelogd,<br>
  88. <A href="index-v1.php">klik hier</a> om door te gaan.</center> \n</td></tr>\n";
  89. }
  90. else {
  91. print " <tr><td class=\"subTitle\"><b><center>Login</center></b></td></tr>\n";
  92. if(isset($_POST['login'],$_POST['pass']))
  93. print " <tr><td class=\"mainTxt\">Verkeerde login of wachtwoord</td></tr>\n";
  94.  
  95. print <<<ENDHTML
  96.   <tr><td class="mainTxt">
  97. <center><img src="images/bliksem.gif"></center>
  98. <form method="post"><table align="center">
  99. <tr><td width=100>Login:</td> <td><input type="text" name="login" maxlength=16 style="width: 150;"></td></tr>
  100. <tr><td width=100>Wachtwoord:</td> <td><input type="password" name="pass" maxlength=16 style="width: 150;"></td></tr>
  101. <tr><td></td><td align="right"><input type="submit" name="submit" style="width: 100;" value="Login"></td></tr>
  102. </table></form>
  103.   </td></tr>
  104.   <tr><td class="mainTxt" align="center"><a href="index.php?x=lostpass">Wachtwoord vergeten?</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="signup.php">Aanmelden</a></td></tr>
  105. ENDHTML;
  106. }
  107.  
  108. /* ------------------------- */ ?>
  109. </table>
  110.  
  111. </body>
  112.  
  113.  
  114. </html>

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