Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
SELECT vorname, nachname, passwort WHERE user = 'hanspeter' AND passwort = '' OR 1 = 1
<?php
$host = "localhost";
$daba = "content";
$user = "root";
$pass = "root";
mysql_connect ($host, $user, $pass) or die ("Keine Verbindung möglich!");
mysql_select_db ($daba) or die ("Die Datenbank existiert nicht. Bitte überprüfen sie den angegebenen Datenbanknamen");
if ((isset($_POST["speichern"]) && !isset($_POST["ID"])) or (isset($_POST["speichern"]) && $_POST["ID"] == "")) {
$strName = mysql_real_escape_string($_POST["strName"]);
$strSlogan = mysql_real_escape_string($_POST["strSlogan"]);
$dblLaenge = mysql_real_escape_string($_POST["dblLaenge"]);
$dblBreite = mysql_real_escape_string($_POST["dblBreite"]);
$dblTiefgang = mysql_real_escape_string($_POST["dblTiefgang"]);
$dblSegelflaeche = mysql_real_escape_string($_POST["dblSegelflaeche"]);
$intBesatzung = mysql_real_escape_string($_POST["intBesatzung"]);
$eintrag = "INSERT INTO schiffe (strName, strSlogan, dblLaenge, dblBreite, dblTiefgang, dblSegelflaeche, intBesatzung) VALUES ('$strName', '$strSlogan', '$dblLaenge', '$dblBreite', '$dblTiefgang', '$dblSegelflaeche', '$intBesatzung'); ";
mysql_query($eintrag);
header("Location:schiffe.php");
} elseif (isset($_POST["speichern"]) && isset($_POST["ID"]) && $_POST["ID"] != "") {
//vorhandenen Eintrag speichern
$strName = mysql_real_escape_string($_POST["strName"]);
$strSlogan = mysql_real_escape_string($_POST["strSlogan"]);
$dblLaenge = mysql_real_escape_string($_POST["dblLaenge"]);
$dblBreite = mysql_real_escape_string($_POST["dblBreite"]);
$dblTiefgang = mysql_real_escape_string($_POST["dblTiefgang"]);
$dblSegelflaeche = mysql_real_escape_string($_POST["dblSegelflaeche"]);
$intBesatzung = mysql_real_escape_string($_POST["intBesatzung"]);
$ID = mysql_real_escape_string($_POST["ID"]);
$update = "UPDATE schiffe SET strName = '" .$strName ."', strSlogan = '" .$strSlogan ."', dblLaenge = '" .$dblLaenge ."', dblBreite = '" .$dblBreite ."', dblTiefgang = '" .$dblTiefgang ."', dblSegelflaeche = '" .$dblSegelflaeche ."', intBesatzung = '". $intBesatzung ."' WHERE ID = '" .$ID ."' LIMIT 1";
mysql_query($update);
header("Location:schiffe.php");
}
if (isset($_GET["id"])) {
$sql = "SELECT * FROM schiffe WHERE ID = '" .mysql_real_escape_string($_GET["id"]) ."' LIMIT 1";
$rs = mysql_query($sql);
$row = mysql_fetch_object($rs);
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
.black_overlay{
display: block;
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
background-color: black;
z-index:1001;
-moz-opacity: 0.8;
opacity:.80;
filter: alpha(opacity=80);
}
.white_content {
display: block;
position: absolute;
top: 0%;
left: 35%;
width: 500px;
height: 400px;
padding: 16px;
border: 0px solid #E8E8E8;
font:Arial, Helvetica, sans-serif;
background-color: none;
z-index:1002;
overflow: auto;
}
#forumlar_headers{
font-family:Arial, Helvetica, sans-serif;
font-size:14px;
font-style:oblique;
color: #FFF;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sail Along - Neues Schiff anlegen</title>
</head>
<body>
<div id="weisser_hintergrund" class="white_content">
<center>
<!-- <img src="login.png" />--><span style="font-family:Arial, Helvetica, sans-serif; font-size:50pt; color:#FFF;">Bearbei</span><span style="font-family:Arial, Helvetica, sans-serif; font-size:50pt; color: #ff0000;">ten</span>
<form name="formular" action="schiffe_bearbeiten.php" method="post">
<table width="500" cellpadding="2" cellspacing="0">
<tr>
<td width="250"><span id="forumlar_headers">Name des Schiffes</span></td>
<td><input type="text" name="strName" id="name" value="<?php echo $row->strName; ?>" /></td>
</tr>
<tr>
<td width="250"><span id="forumlar_headers">Slogan</span></td>
<td><input type="text" name="strSlogan" id="strSlogan" value="<?php echo $row->strSlogan; ?>" /></td>
</tr>
<tr>
<td width="250"><span id="forumlar_headers">Länge</span></td>
<td><input type="text" name="dblLaenge" id="dblLaenge" value="<?php echo $row->dblLaenge; ?>" /></td>
</tr>
<tr>
<td width="250"><span id="forumlar_headers">Breite</span></td>
<td><input type="text" name="dblBreite" id="dblBreite" value="<?php echo $row->dblBreite; ?>" /></td>
</tr>
<tr>
<td width="250"><span id="forumlar_headers">Tiefgang</span></td>
<td><input type="text" name="dblTiefgang" id="dblTiefgang" value="<?php echo $row->dblTiefgang; ?>" /></td>
</tr>
<tr>
<td width="250"><span id="forumlar_headers">Segelfläche</span></td>
<td><input type="text" name="dblSegelflaeche" id="dblSegelflaeche" value="<?php echo $row->dblSegelflaeche; ?>" /></td>
</tr>
<tr>
<td width="250"><span id="forumlar_headers">Besatzung</span></td>
<td><input type="text" name="intBesatzung" id="intBesatzung" value="<?php echo $row->intBesatzung; ?>" /></td>
</tr>
<tr>
<td width="250"><input type="hidden" name="ID" value="<? echo $row->ID; ?>"/></td>
<td><input type="submit" name="speichern" Value="Speichern" /></td>
</tr>
</table>
</form>
<!--Link zum schließen-->
</center>
</div>
<div id="schwarzer_hintergrund" class="black_overlay"></div>
<?php
$host = "localhost";
$daba = "content";
$user = "xxx";
$pass = "xxx";
mysql_connect ($host, $user, $pass) or die ("Keine Verbindung möglich!");
mysql_select_db ($daba) or die ("Die Datenbank existiert nicht. Bitte überprüfen sie den angegebenen Datenbanknamen");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
.black_overlay{
display: block;
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
background-color: black;
z-index:1001;
-moz-opacity: 0.4;
opacity:.40;
filter: alpha(opacity=40);
}
.white_content {
display: block;
position: absolute;
top: 0%;
left: 35%;
width: 500px;
height: 400px;
padding: 16px;
border: 0px solid #E8E8E8;
font:Arial, Helvetica, sans-serif;
background-color: none;
z-index:1002;
overflow: auto;
}
#forumlar_headers{
font-family:Arial, Helvetica, sans-serif;
font-size:14px;
font-style:oblique;
color: #FFF;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sail Along </title>
</head>
<body>
<form name="formular" action="schiffe.php" method="post">
<table width="850" cellpadding="2" cellspacing="0">
<tr>
<td><input type="submit" name="Neu" value="Neues Schiff anlegen" /></td>
</tr>
</table>
<p> </p>
<table width="850" cellpadding="2" cellspacing="0">
<tr>
<td>Name des Schiffes</td><td>Slogan</td><td>Länge</td><td>Breite</td><td>Tiefgang</td><td>Segelfläche</td><td>Besatzung</td><td>ID</td><td> </td>
</tr>
<?php
$f1 = "#999999";
$f2 = "#FFFFFF";
$ergebnis = mysql_query("SELECT * FROM schiffe");
while($row = mysql_fetch_object($ergebnis)) {
if ($farbe == $f1) {
$farbe = $f2;
} else {
$farbe = $f1;
}
?>
<hr size="15" />
<?php
If (isset($_GET["ID"]) && isset($_GET["art"]) && $_GET["art"] == 1) {
//-----------------------------------------------------------------------------------------------------------------------------------------------------
$sql = "SELECT * FROM schiffe WHERE ID = '" .mysql_real_escape_string($_GET["ID"]) ."' LIMIT 1";
$rs = mysql_query($sql);
$row = mysql_fetch_object($rs);
echo "<div id=\"weisser_hintergrund\" class=\"white_content\">";
echo "<center>";
echo "<span style=\"font-family:Arial, Helvetica, sans-serif; font-size:50pt; color:#FFF;\">Bearbei</span><span style=\"font-family:Arial, Helvetica, sans-serif; font-size:50pt; color: #ff0000;\">ten</span>";
echo "<form name=\"formular\" action=\"schiffe.php\" method=\"post\" id=\"forumlar_headers\">";
echo "<table width=\"500\" cellpadding=\"2\" cellspacing=\"0\">";
echo " <tr>";
echo " <td width=\"250\">Name des Schiffes</td>";
echo " <td><input type=\"text\" name=\"strName\" id=\"name\" value=\"$row->strName\" /></td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Slogan</td>";
echo " <td><input type=\"text\" name=\"strSlogan\" id=\"strSlogan\" value=\"$row->strSlogan\" /></td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Länge</td>";
echo " <td><input type=\"text\" name=\"dblLaenge\" id=\"dblLaenge\" value=\"$row->dblLaenge\" /></td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Breite</td>";
echo " <td><input type=\"text\" name=\"dblBreit\" id=\"dblBreite\" value=\"$row->dblBreite\" /></td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Tiefgang</td>";
echo " <td><input type=\"text\" name=\"dblTiefgang\" id=\"dblTiefgang\" value=\"$row->dblTiefgang\" /></td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Segelfläche</td>";
echo " <td><input type=\"text\" name=\"dblSegelflaeche\" id=\"dblSegelflaeche\" value=\"$row->dblSegelflaeche\" /></td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Besatzung</td>";
echo " <td><input type=\"text\" name=\"intBesatzung\" id=\"intBesatzung\" value=\"$row->intBesatzung\" /></td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\"><input type=\"text\" name=\"ID\" value=\"$row->ID\"/></td>";
echo " <td><input type=\"submit\" name=\"speichern\" value=\"Speichern\" /></td>";
echo " </tr>";
echo " </table>";
echo " </form>";
// <!--Link zum schließen-->
echo " </center>";
echo " </div>";
echo " <div id=\"schwarzer_hintergrund\" class=\"black_overlay\"></div>";
//echo "<input type=\"text\" value=\"$row->strName\" />";
//---------------------------------------------------------------------------------------------------------------------
if (isset($_POST["speichern"]) && isset($_POST["ID"]) && $_POST["ID"] != "") {
//vorhandenen Eintrag speichern
$strName = mysql_real_escape_string($_POST["strName"]);
$strSlogan = mysql_real_escape_string($_POST["strSlogan"]);
$dblLaenge = mysql_real_escape_string($_POST["dblLaenge"]);
$dblBreite = mysql_real_escape_string($_POST["dblBreite"]);
$dblTiefgang = mysql_real_escape_string($_POST["dblTiefgang"]);
$dblSegelflaeche = mysql_real_escape_string($_POST["dblSegelflaeche"]);
$intBesatzung = mysql_real_escape_string($_POST["intBesatzung"]);
$ID = mysql_real_escape_string($_POST["ID"]);
$update = "UPDATE schiffe SET strName = '" .$strName ."', strSlogan = '" .$strSlogan ."', dblLaenge = '" .$dblLaenge ."', dblBreite = '" .$dblBreite ."', dblTiefgang = '" .$dblTiefgang ."', dblSegelflaeche = '" .$dblSegelflaeche ."', intBesatzung = '". $intBesatzung ."' WHERE ID = '" .$ID ."' LIMIT 1";
mysql_query($update);
}
//----------------------------------------------------------------------------------------------------------------------------------------------------- // hier kommt der Code hin um den bestehenden Datensatz zu bearbeiten
} ElseIf (isset($_GET["ID"]) && isset($_GET["art"]) && $_GET["art"] == 2) {
$sql = "SELECT * FROM schiffe WHERE ID = '" .mysql_real_escape_string($_GET["ID"]) ."' LIMIT 1";
$rs = mysql_query($sql);
$row = mysql_fetch_object($rs);
echo "<div id=\"weisser_hintergrund\" class=\"white_content\">";
echo "<center>";
echo "<span style=\"font-family:Arial, Helvetica, sans-serif; font-size:50pt; color:#FFF;\">Lösch</span><span style=\"font-family:Arial, Helvetica, sans-serif; font-size:50pt; color: #ff0000;\">en</span>";
echo " <form name=\"formular\" action=\"schiffe.php\" method=\"post\" id=\"forumlar_headers\">";
echo " <table width=\"500\" cellpadding=\"2\" cellspacing=\"0\" >";
echo " <tr>";
echo " <td width=\"250\">ID</td>";
echo " <td>$row->ID</td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Name des Schiffes</td>";
echo " <td>$row->strName</td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Slogan</td>";
echo " <td>$row->strSlogan</td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Länge</td>";
echo " <td>$row->dblLaenge</td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Breite</td>";
echo " <td>$row->dblBreite</td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Tiefgang</td>";
echo " <td>$row->dblTiefgang</td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Segelfläche</td>";
echo " <td>$row->dblSegelflaeche</td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Besatzung</td>";
echo " <td>$row->intBesatzung</td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\"><input type=\"submit\" name=\"abbrechen\" value=\"Abbrechen\" />";
echo " <td width=\"250\"><input type=\"text\" name=\"ID\" value=\"$row->ID\"/></td>";
echo " <td><input type=\"submit\" name=\"loeschen\" value=\"Löschen\" /></td>";
echo " </tr>";
echo " </table>";
echo " </form>";
echo " </center>";
echo " </div>";
echo " <div id=\"schwarzer_hintergrund\" class=\"black_overlay\"></div>";
// hier kommt der Code hin um den Datensatz zu löschen
} Else {
// hier kommt der Code hin wenn die Seite "normal" aufgerufen wurde
}
?>
<tr bgcolor="<?php echo $farbe; ?>">
<td><?php echo $row->strName; ?></td>
<td><?php echo $row->strSlogan; ?></td>
<td><?php echo $row->dblLaenge; ?></td>
<td><?php echo $row->dblBreite; ?></td>
<td><?php echo $row->dblTiefgang; ?></td>
<td><?php echo $row->dblSegelflaeche; ?></td>
<td><?php echo $row->intBesatzung; ?></td>
<td><?php echo $row->ID;?></td>
<td ><a name="ID" href="schiffe.php?ID=<?php echo $row->ID;?>&art=1">Bearbeiten</a></td>
<td><a name="ID" href="schiffe.php?ID=<?php echo $row->ID;?>&art=2">Löschen</a></td>
</tr>
<?php } ?>
</table>
</form>
</body>
</html>
<?php
$host = "localhost";
$daba = "content";
$user = "xxx";
$pass = "yyy";
mysql_connect ($host, $user, $pass) or die ("Keine Verbindung möglich!");
mysql_select_db ($daba) or die ("Die Datenbank existiert nicht. Bitte überprüfen sie den angegebenen Datenbanknamen");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
.black_overlay{
display: block;
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
background-color: black;
z-index:1001;
-moz-opacity: 0.4;
opacity:.40;
filter: alpha(opacity=40);
}
.white_content {
display: block;
position: absolute;
top: 0%;
left: 35%;
width: 500px;
height: 400px;
padding: 16px;
border: 0px solid #E8E8E8;
font:Arial, Helvetica, sans-serif;
background-color: none;
z-index:1002;
overflow: auto;
}
#forumlar_headers{
font-family:Arial, Helvetica, sans-serif;
font-size:14px;
font-style:oblique;
color: #FFF;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sail Along </title>
</head>
<body>
<form name="formular" action="schiffe.php" method="post">
<?php
if (isset($_POST["neu"])) {
echo "<div id=\"weisser_hintergrund\" class=\"white_content\">";
echo "<center>";
echo "<span style=\"font-family:Arial, Helvetica, sans-serif; font-size:50pt; color:#FFF;\">Anle</span><span style=\"font-family:Arial, Helvetica, sans-serif; font-size:50pt; color: #ff0000;\">gen</span>";
echo "<table width=\"500\" cellpadding=\"2\" cellspacing=\"0\">";
echo " <tr>";
echo " <td width=\"250\">Name des Schiffes</td>";
echo " <td><input type=\"text\" name=\"strName\" id=\"name\" /></td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Slogan</td>";
echo " <td><input type=\"text\" name=\"strSlogan\" id=\"strSlogan\" /></td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Länge</td>";
echo " <td><input type=\"text\" name=\"dblLaenge\" id=\"dblLaenge\" /></td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Breite</td>";
echo " <td><input type=\"text\" name=\"dblBreit\" id=\"dblBreite\" /></td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Tiefgang</td>";
echo " <td><input type=\"text\" name=\"dblTiefgang\" id=\"dblTiefgang\" /></td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Segelfläche</td>";
echo " <td><input type=\"text\" name=\"dblSegelflaeche\" id=\"dblSegelflaeche\" /></td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Besatzung</td>";
echo " <td><input type=\"text\" name=\"intBesatzung\" id=\"intBesatzung\" /></td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\"></td>";
echo " <td><input type=\"submit\" name=\"speichern_neu\" value=\"Speichern\" /></td>";
echo " </tr>";
echo " </table>";
echo " </center>";
echo " </div>";
echo " <div id=\"schwarzer_hintergrund\" class=\"black_overlay\"></div>";
} elseif (isset($_GET["ID"]) && isset($_GET["art"]) && $_GET["art"] == 1) {
$sql = "SELECT * FROM schiffe WHERE ID = '" .mysql_real_escape_string($_GET["ID"]) ."' LIMIT 1";
$rs = mysql_query($sql);
$row = mysql_fetch_object($rs);
echo "<div id=\"weisser_hintergrund\" class=\"white_content\">";
echo "<center>";
echo "<span style=\"font-family:Arial, Helvetica, sans-serif; font-size:50pt; color:#FFF;\">Bearbei</span><span style=\"font-family:Arial, Helvetica, sans-serif; font-size:50pt; color: #ff0000;\">ten</span>";
echo "<table width=\"500\" cellpadding=\"2\" cellspacing=\"0\">";
echo " <tr>";
echo " <td width=\"250\">Name des Schiffes</td>";
echo " <td><input type=\"text\" name=\"strName\" id=\"name\" value=\"$row->strName\" /></td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Slogan</td>";
echo " <td><input type=\"text\" name=\"strSlogan\" id=\"strSlogan\" value=\"$row->strSlogan\" /></td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Länge</td>";
echo " <td><input type=\"text\" name=\"dblLaenge\" id=\"dblLaenge\" value=\"$row->dblLaenge\" /></td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Breite</td>";
echo " <td><input type=\"text\" name=\"dblBreit\" id=\"dblBreite\" value=\"$row->dblBreite\" /></td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Tiefgang</td>";
echo " <td><input type=\"text\" name=\"dblTiefgang\" id=\"dblTiefgang\" value=\"$row->dblTiefgang\" /></td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Segelfläche</td>";
echo " <td><input type=\"text\" name=\"dblSegelflaeche\" id=\"dblSegelflaeche\" value=\"$row->dblSegelflaeche\" /></td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Besatzung</td>";
echo " <td><input type=\"text\" name=\"intBesatzung\" id=\"intBesatzung\" value=\"$row->intBesatzung\" /></td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\"><input type=\"text\" name=\"ID\" value=\"$row->ID\"/></td>";
echo " <td><input type=\"submit\" name=\"speichern\" value=\"Speichern\" /></td>";
echo " </tr>";
echo " </table>";
echo " </center>";
echo " </div>";
echo " <div id=\"schwarzer_hintergrund\" class=\"black_overlay\"></div>";
} elseif (isset($_POST["speichern_neu"])) {
//neuen Eintrag speichern
$strName = mysql_real_escape_string($_POST["strName"]);
$strSlogan = mysql_real_escape_string($_POST["strSlogan"]);
$dblLaenge = mysql_real_escape_string($_POST["dblLaenge"]);
$dblBreite = mysql_real_escape_string($_POST["dblBreite"]);
$dblTiefgang = mysql_real_escape_string($_POST["dblTiefgang"]);
$dblSegelflaeche = mysql_real_escape_string($_POST["dblSegelflaeche"]);
$intBesatzung = mysql_real_escape_string($_POST["intBesatzung"]);
$ID = mysql_real_escape_string($_POST["ID"]);
$insert = "INSERT INTO schiffe (strName, strSlogan, dblLaenge, dblBreite, dblTiefgang, dblSegelflaeche, intBesatzung) VALUES('" .$strName ."', '" .$strSlogan ."', '" .$dblLaenge ."', '" .$dblBreite ."', '" .$dblTiefgang ."', '" .$dblSegelflaeche ."', '". $intBesatzung ."')";
mysql_query($insert);
} elseif (isset($_POST["speichern"]) && isset($_POST["ID"]) && $_POST["ID"] != "") {
//vorhandenen Eintrag speichern
$strName = mysql_real_escape_string($_POST["strName"]);
$strSlogan = mysql_real_escape_string($_POST["strSlogan"]);
$dblLaenge = mysql_real_escape_string($_POST["dblLaenge"]);
$dblBreite = mysql_real_escape_string($_POST["dblBreite"]);
$dblTiefgang = mysql_real_escape_string($_POST["dblTiefgang"]);
$dblSegelflaeche = mysql_real_escape_string($_POST["dblSegelflaeche"]);
$intBesatzung = mysql_real_escape_string($_POST["intBesatzung"]);
$ID = mysql_real_escape_string($_POST["ID"]);
$update = "UPDATE schiffe SET strName = '" .$strName ."', strSlogan = '" .$strSlogan ."', dblLaenge = '" .$dblLaenge ."', dblBreite = '" .$dblBreite ."', dblTiefgang = '" .$dblTiefgang ."', dblSegelflaeche = '" .$dblSegelflaeche ."', intBesatzung = '". $intBesatzung ."' WHERE ID = '" .$ID ."' LIMIT 1";
mysql_query($update);
} ElseIf (isset($_GET["ID"]) && isset($_GET["art"]) && $_GET["art"] == 2) {
$sql = "SELECT * FROM schiffe WHERE ID = '" .mysql_real_escape_string($_GET["ID"]) ."' LIMIT 1";
$rs = mysql_query($sql);
$row = mysql_fetch_object($rs);
echo "<div id=\"weisser_hintergrund\" class=\"white_content\">";
echo "<center>";
echo "<span style=\"font-family:Arial, Helvetica, sans-serif; font-size:50pt; color:#FFF;\">Lösch</span><span style=\"font-family:Arial, Helvetica, sans-serif; font-size:50pt; color: #ff0000;\">en</span>";
echo " <table width=\"500\" cellpadding=\"2\" cellspacing=\"0\" >";
echo " <tr>";
echo " <td width=\"250\">ID</td>";
echo " <td>$row->ID</td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Name des Schiffes</td>";
echo " <td>$row->strName</td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Slogan</td>";
echo " <td>$row->strSlogan</td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Länge</td>";
echo " <td>$row->dblLaenge</td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Breite</td>";
echo " <td>$row->dblBreite</td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Tiefgang</td>";
echo " <td>$row->dblTiefgang</td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Segelfläche</td>";
echo " <td>$row->dblSegelflaeche</td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\">Besatzung</td>";
echo " <td>$row->intBesatzung</td>";
echo " </tr>";
echo " <tr>";
echo " <td width=\"250\"><input type=\"submit\" name=\"abbrechen\" value=\"Abbrechen\" />";
echo " <td width=\"250\"><input name=\"ID\" type=\"hidden\" value=\"$row->ID\" /></td>";
echo " <td><input type=\"submit\" name=\"loeschen\" value=\"Löschen\" /></td>";
echo " </tr>";
echo " </table>";
echo " </center>";
echo " </div>";
echo " <div id=\"schwarzer_hintergrund\" class=\"black_overlay\"></div>";
} elseif (isset($_POST["loeschen"]) && isset($_POST["ID"])) {
$delete = "DELETE FROM schiffe WHERE ID = '" .mysql_real_escape_string($_POST["ID"]) ."' LIMIT 1";
mysql_query($delete);
}
?>
<table width="850" cellpadding="2" cellspacing="0">
<tr>
<td><input type="submit" name="neu" value="Neues Schiff anlegen" /></td>
</tr>
</table>
<p> </p>
<table width="850" cellpadding="2" cellspacing="0">
<tr>
<td>Name des Schiffes</td><td>Slogan</td><td>Länge</td><td>Breite</td><td>Tiefgang</td><td>Segelfläche</td><td>Besatzung</td><td>ID</td><td> </td>
</tr>
<?php
$f1 = "#999999";
$f2 = "#FFFFFF";
$ergebnis = mysql_query("SELECT * FROM schiffe");
while($row = mysql_fetch_object($ergebnis)) {
if ($farbe == $f1) {
$farbe = $f2;
} else {
$farbe = $f1;
}
?>
<tr bgcolor="<?php echo $farbe; ?>">
<td><?php echo $row->strName; ?></td>
<td><?php echo $row->strSlogan; ?></td>
<td><?php echo $row->dblLaenge; ?></td>
<td><?php echo $row->dblBreite; ?></td>
<td><?php echo $row->dblTiefgang; ?></td>
<td><?php echo $row->dblSegelflaeche; ?></td>
<td><?php echo $row->intBesatzung; ?></td>
<td><?php echo $row->ID;?></td>
<td ><a name="ID" href="schiffe.php?ID=<?php echo $row->ID;?>&art=1">Bearbeiten</a></td>
<td><a name="ID" href="schiffe.php?ID=<?php echo $row->ID;?>&art=2">Löschen</a></td>
</tr>
<?php } ?>
</table>
</form>
</body>
</html>