Kontextwechsel beachten!
... tut mir Leid, das mit dem "Kontextwechsel" verstehe ich einfach nicht
<html>
<head>
<title>Update Formular</title>
</head>
<BODY onLoad="CheckStations()">
<form action="" method="post">
<?php
// Datenbankzugriff
include("admin/includes/config.php");
$conID = mysql_connect($db_host, $db_user, $db_pass );
if (!$conID) {
die('keine Verbindung möglich: ' . mysql_error());
}
mysql_select_db( $db_name, $conID );
if(isset($_POST["submitted"])) {
$_sql = "UPDATE FW_Fehlerbericht
SET M_NAME = '".$_POST["M_NAME"]."',
SCHICHT = '".$_POST["SCHICHT"]."',
ORT = '".$_POST["ORT"]."',
KURZBESCHREIBUNG = '".$_POST["KURZBESCHREIBUNG"]."'
WHERE ID = ".$_POST["ID"]."";
$ergebnis = mysql_query($_sql,$conID);
if (!$ergebnis) {
echo "Es ist ein Fehler aufgetreten: ".mysql_error($conID);
}
}
$ergebnis = mysql_query( "SELECT * FROM FW_Fehlerbericht WHERE ID = ".intval($_GET["ID"]));
while ( $datensatz = mysql_fetch_array( $ergebnis ) ) {
?>
<div>
Datensatz Nr.: <?=$datensatz["ID"]?><p>
</div>
<table>
<tr>
<td valign="top"><input type="hidden" id="ID" name="ID" size="35" value="<?php echo $datensatz["ID"]; ?>"></td>
<td valign="top"><input type="text" id="M_NAME" name="M_NAME" size="35" value="<?php echo $datensatz["M_NAME"]; ?>"></td>
<td valign="top"><input type="text" id="SCHICHT" name="SCHICHT" size="35" value="<?php echo $datensatz["SCHICHT"]; ?>"></td>
<td valign="top"><input type="text" id="ORT" name="ORT" size="35" value="<?php echo $datensatz["ORT"]; ?>"></td>
<td valign="top"><input type="text" id="KURZBESCHREIBUNG" name="KURZBESCHREIBUNG" size="35" value="<?php echo $datensatz["KURZBESCHREIBUNG"]; ?>"></td>
<td><p></td>
</tr>
</table>
<?php
mysql_close($conID);
?>
<input type="submit" name="submitted" value="Übernehmen">
</form>
<?php
}
?>
</html>