login  Naam:   Wachtwoord: 
Registreer je!
 Forum

Vraag...

Offline Marly - 11/11/2004 12:32
Avatar van MarlyHTML interesse Hallo,
Ik krijg hier een error op de laatste regel.

Parse error: parse error, unexpected $end in C:\xampp\xampp\htdocs\Game Night\cheats\cheats-admin.php on line 100

  1. <?php
  2. $ww = "passwoord";
  3. $gb = "naam";
  4.  
  5. if($_POST["sub"] == "login"){
  6. if($_POST["gb"] == $gb && $_GET["ww"] == $ww){
  7. $_SESSION["cheatadminlogin"] = "1";
  8. $login = "ja";
  9. }
  10. else{
  11. echo"Jmmr, nog een keer";
  12. }
  13. }
  14. if($_SESSION["cheatadminlogin"] == "1" || $login = "ja"){
  15.  
  16. if($_GET["actieb"] == "iddel"){
  17. if($_GET["sub"] == "Ja"){
  18. $dbh=mysql_connect("localhost", "", "") or die ('I cannot connect to the database because: ' . mysql_error());
  19. mysql_select_db ("GN", $dbh);
  20. $sql = "DELETE FROM cheats WHERE id=".$_GET["id"];
  21. mysql_query($sql) or die(mysql_error()."<BR><BR>$sql");
  22. echo"Succesvol verwijderd";
  23. }else{echo"Cheat niet verwijderd";}
  24. }
  25. elseif($_POST["actieb"] == "new"){
  26. $dbh=mysql_connect("localhost", "naam", "pass") or die ('I cannot connect to the database because: ' . mysql_error());
  27. mysql_select_db ("db", $dbh);
  28. $z=$_POST["naam"];
  29. if($z{0} == "0"){$x= "0-9";}
  30. elseif($z{0} == "1"){$x= "0-9";}
  31. elseif($z{0} == "2"){$x= "0-9";}
  32. elseif($z{0} == "3"){$x= "0-9";}
  33. elseif($z{0} == "4"){$x= "0-9";}
  34. elseif($z{0} == "5"){$x= "0-9";}
  35. elseif($z{0} == "6"){$x= "0-9";}
  36. elseif($z{0} == "7"){$x= "0-9";}
  37. elseif($z{0} == "8"){$x= "0-9";}
  38. elseif($z{0} == "9"){$x= "0-9";}
  39. else{$x=$z{0};}
  40.  
  41. $text=ereg_replace("\n", "<br>", $_POST["text"]);
  42.  
  43. $sqldate=date("H:i:s Y-m-d");
  44. $sql = "INSERT INTO cheats (`naam`, `text`, `datum`, `letter`)VALUES('".$_POST["naam"]."', '".$text."', '".$sqldate."', '".$x."')";
  45.  
  46.  
  47. mysql_query($sql) or die("<b>$sql</b>flikker toch op".mysql_error());
  48. echo"succesvol toegevoegd";
  49. }
  50. elseif($_POST["actieb"] == "idedit"){
  51. $dbh=mysql_connect("localhost", "naam", "pass") or die ('I cannot connect to the database because: ' . mysql_error());
  52. mysql_select_db ("dbnaam", $dbh);
  53. $z=$_POST["naam"];
  54. if($z{0} == "0"){$x= "0-9";}
  55. elseif($z{0} == "1"){$x= "0-9";}
  56. elseif($z{0} == "2"){$x= "0-9";}
  57. elseif($z{0} == "3"){$x= "0-9";}
  58. elseif($z{0} == "4"){$x= "0-9";}
  59. elseif($z{0} == "5"){$x= "0-9";}
  60. elseif($z{0} == "6"){$x= "0-9";}
  61. elseif($z{0} == "7"){$x= "0-9";}
  62. elseif($z{0} == "8"){$x= "0-9";}
  63. elseif($z{0} == "9"){$x= "0-9";}
  64. else{$x=$z{0};}
  65. $text=ereg_replace("\n", "<br>", $_POST["text"]);
  66. $sql = "UPDATE cheats SET naam='".$_POST["naam"]."', letter = '".$x."', text='".$text."' WHERE id=".$_POST["id"];
  67. mysql_query($sql) or die(mysql_error()."<BR><BR><b>$sql</b>");
  68. echo"suc6vol bewerkt!";
  69. }
  70. elseif($_GET["actie"] == "idedit"){
  71.  
  72.  
  73. $dbh=mysql_connect("localhost", "naam", "pass") or die ('I cannot connect to the database because: ' . mysql_error());
  74. mysql_select_db ("dbnaam", $dbh);
  75. $sql="SELECT * FROM cheats WHERE id='".$_POST["id"]."'";
  76. $resultaat = mysql_query($sql) or die(mysql_error());
  77. if(mysql_num_rows($resultaat) == 0){echo"Dit id bestaat niet!";}
  78. while ($record = mysql_fetch_object($resultaat)) {
  79. $text=ereg_replace("<br>", "\n", $record->text);
  80. echo"<form action='' method='post'><input type='hidden' name='id' value='".$_POST["id"]."'><input type=hidden name='actieb' value='idedit'>naam: <input type='text' name='naam' value='$record->naam'><BR>text:<BR><textarea name='text'>$text</textarea><input type=submit name='edit' value='edit'></form>";
  81. }
  82.  
  83.  
  84. }
  85. elseif($_GET["actie"] == "new"){
  86.  
  87. echo"<form action='cheats-admin.php' method='post'><input type=hidden name='actieb' value='new'>naam: <input type='text' name='naam'><BR>text:<BR><textarea name='text'></textarea><input type=submit name='edit' value='Voeg Toe'></form>";
  88.  
  89.  
  90. }
  91. elseif($_GET["actie"] == "iddel"){
  92.  
  93.  
  94. echo"<form action='cheats-admin.php'><input type=hidden name=actieb value='iddel'><input type=hidden name='id' value='".$_POST['id']."'>ckers weten dat je cheat<b>id ".$_POST['id']."</b> wilt deleten?<BR><BR><input type='submit' name='sub' value='Ja'><input type='submit' name='sub' value='Nee'></form>";
  95.  
  96.  
  97. }else{
  98.  
  99. echo"<form action='cheats-admin.php?actie=new' method='post'><br>Nieuwe Cheat</b>:<br><input type='submit' name='sub' value='Nieuw'></form><HR>";

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.206s