HTML 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
<?php
session_start();
$ww = "passwoord";
$gb = "naam";
if($_POST["sub"] == "login"){
if($_POST["gb"] == $gb && $_GET["ww"] == $ww){
$_SESSION["cheatadminlogin"] = "1";
$login = "ja";
}
else{
echo"Jmmr, nog een keer";
}
}
if($_SESSION["cheatadminlogin"] == "1" || $login = "ja"){
if($_GET["actieb"] == "iddel"){
if($_GET["sub"] == "Ja"){
$dbh=mysql_connect("localhost", "", "") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("GN", $dbh);
$sql = "DELETE FROM cheats WHERE id=".$_GET["id"];
mysql_query($sql) or die(mysql_error()."<BR><BR>$sql");
echo"Succesvol verwijderd";
}else{echo"Cheat niet verwijderd";}
}
elseif($_POST["actieb"] == "new"){
$dbh=mysql_connect("localhost", "naam", "pass") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("db", $dbh);
$z=$_POST["naam"];
if($z{0} == "0"){$x= "0-9";}
elseif($z{0} == "1"){$x= "0-9";}
elseif($z{0} == "2"){$x= "0-9";}
elseif($z{0} == "3"){$x= "0-9";}
elseif($z{0} == "4"){$x= "0-9";}
elseif($z{0} == "5"){$x= "0-9";}
elseif($z{0} == "6"){$x= "0-9";}
elseif($z{0} == "7"){$x= "0-9";}
elseif($z{0} == "8"){$x= "0-9";}
elseif($z{0} == "9"){$x= "0-9";}
else{$x=$z{0};}
$text=ereg_replace("\n", "<br>", $_POST["text"]);
$sqldate=date("H:i:s Y-m-d");
$sql = "INSERT INTO cheats (`naam`, `text`, `datum`, `letter`)VALUES('".$_POST["naam"]."', '".$text."', '".$sqldate."', '".$x."')";
mysql_query($sql) or die("<b>$sql</b>flikker toch op".mysql_error());
echo"succesvol toegevoegd";
}
elseif($_POST["actieb"] == "idedit"){
$dbh=mysql_connect("localhost", "naam", "pass") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("dbnaam", $dbh);
$z=$_POST["naam"];
if($z{0} == "0"){$x= "0-9";}
elseif($z{0} == "1"){$x= "0-9";}
elseif($z{0} == "2"){$x= "0-9";}
elseif($z{0} == "3"){$x= "0-9";}
elseif($z{0} == "4"){$x= "0-9";}
elseif($z{0} == "5"){$x= "0-9";}
elseif($z{0} == "6"){$x= "0-9";}
elseif($z{0} == "7"){$x= "0-9";}
elseif($z{0} == "8"){$x= "0-9";}
elseif($z{0} == "9"){$x= "0-9";}
else{$x=$z{0};}
$text=ereg_replace("\n", "<br>", $_POST["text"]);
$sql = "UPDATE cheats SET naam='".$_POST["naam"]."', letter = '".$x."', text='".$text."' WHERE id=".$_POST["id"];
mysql_query($sql) or die(mysql_error()."<BR><BR><b>$sql</b>");
echo"suc6vol bewerkt!";
}
elseif($_GET["actie"] == "idedit"){
$dbh=mysql_connect("localhost", "naam", "pass") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db ("dbnaam", $dbh);
$sql="SELECT * FROM cheats WHERE id='".$_POST["id"]."'";
$resultaat = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($resultaat) == 0){echo"Dit id bestaat niet!";}
while ($record = mysql_fetch_object($resultaat)) {
$text=ereg_replace("<br>", "\n", $record->text);
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>";
}
}
elseif($_GET["actie"] == "new"){
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>";
}
elseif($_GET["actie"] == "iddel"){
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>";
}else{
echo"<form action='cheats-admin.php?actie=new' method='post'><br>Nieuwe Cheat</b>:<br><input type='submit' name='sub' value='Nieuw'></form><HR>";
<?php $ww = "passwoord"; $gb = "naam"; if($_POST["sub"] == "login"){ if($_POST["gb"] == $gb && $_GET["ww"] == $ww){ $_SESSION["cheatadminlogin"] = "1"; $login = "ja"; } else{ echo"Jmmr, nog een keer"; } } if($_SESSION["cheatadminlogin"] == "1" || $login = "ja"){ if($_GET["actieb"] == "iddel"){ if($_GET["sub"] == "Ja"){ $sql = "DELETE FROM cheats WHERE id=".$_GET["id"]; echo"Succesvol verwijderd"; }else{echo"Cheat niet verwijderd";} } elseif($_POST["actieb"] == "new"){ $z=$_POST["naam"]; if($z{0} == "0"){$x= "0-9";} elseif($z{0} == "1"){$x= "0-9";} elseif($z{0} == "2"){$x= "0-9";} elseif($z{0} == "3"){$x= "0-9";} elseif($z{0} == "4"){$x= "0-9";} elseif($z{0} == "5"){$x= "0-9";} elseif($z{0} == "6"){$x= "0-9";} elseif($z{0} == "7"){$x= "0-9";} elseif($z{0} == "8"){$x= "0-9";} elseif($z{0} == "9"){$x= "0-9";} else{$x=$z{0};} $sqldate=date("H:i:s Y-m-d"); $sql = "INSERT INTO cheats (`naam`, `text`, `datum`, `letter`)VALUES('".$_POST["naam"]."', '".$text."', '".$sqldate."', '".$x."')"; echo"succesvol toegevoegd"; } elseif($_POST["actieb"] == "idedit"){ $z=$_POST["naam"]; if($z{0} == "0"){$x= "0-9";} elseif($z{0} == "1"){$x= "0-9";} elseif($z{0} == "2"){$x= "0-9";} elseif($z{0} == "3"){$x= "0-9";} elseif($z{0} == "4"){$x= "0-9";} elseif($z{0} == "5"){$x= "0-9";} elseif($z{0} == "6"){$x= "0-9";} elseif($z{0} == "7"){$x= "0-9";} elseif($z{0} == "8"){$x= "0-9";} elseif($z{0} == "9"){$x= "0-9";} else{$x=$z{0};} $sql = "UPDATE cheats SET naam='".$_POST["naam"]."', letter = '".$x."', text='".$text."' WHERE id=".$_POST["id"]; } elseif($_GET["actie"] == "idedit"){ $sql="SELECT * FROM cheats WHERE id='".$_POST["id"]."'"; 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>"; } } elseif($_GET["actie"] == "new"){ 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>"; } elseif($_GET["actie"] == "iddel"){ 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>"; }else{ echo"<form action='cheats-admin.php?actie=new' method='post'><br>Nieuwe Cheat</b>:<br><input type='submit' name='sub' value='Nieuw'></form><HR>";
|