<?
include "config.php";
$db;
global $db;
$db = mysql_connect($db_server, $db_user, $db_passwort)
or die("Öffnen der Verbindung zum MySQL-Server gescheitert");
$db_check = @MYSQL_SELECT_DB($db_name);if($db) echo "";
function holeFeld($feld, $fnm, $fval)
{
global $db;
$sql = "SELECT $feld FROM liste WHERE $fnm='$fval'";
$ergebnis= mysql_query($sql, $db);
while($row = mysql_fetch_object($ergebnis))
{
return $row->$feld;
}
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- TemplateBeginEditable name="doctitle" -->
<title>Unbenanntes Dokument</title>
<!-- TemplateEndEditable -->
<!-- TemplateBeginEditable name="head" -->
<!-- TemplateEndEditable -->
<style type="text/css">
<!--
body,td,th {
color: #FFFFFF;
}
body {
background-color: #02679D;
}
a:link {
color: #FFFFFF;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #CCCCCC;
}
a:hover {
text-decoration: underline;
}
a:active {
text-decoration: none;
color: #CCCCCC;
}
-->
</style></head>
<body>
<form name="form1" method="get" action="update.php">
<label>
Name:
<input name="name" type="text" id="name" value="<? print holeFeld("name","id",$id); ?>">
</label>
<br>
<label>Lateinischer Name:
<input name="latein" type="text" id="latein" value="<? print holeFeld("latein","id",$id); ?>">
</label>
<br>
Gattung:
<label>
<input name="gattung" type="text" id="gattung" value="<? print holeFeld("gattung","id",$id); ?>">
</label>
<br>
Im Stammsortiment ?
<label>
<input name="stamm" type="checkbox" id="stamm" value="1" <? if(holeFeld("stamm","id",$id)==1) { print "checked"; } ?>>
</label>
<br>
Ist es eine Rarität ?
<label>
<input name="rar" type="checkbox" id="rar" value="1" <? if(holeFeld("rar","id",$id)==1) { print "checked"; } ?>>
</label>
<br>
Ist dieser Fisch neu im Sortiment ?
<label>
<input name="neu" type="checkbox" id="neu" value="1" <? if(holeFeld("neu","id",$id)==1) { print "checked"; } ?>>
</label>
<p>
<label>
<input type="submit" name="Submit" value="ändern">
</label>
</p>
<p>
<input name="id" type="hidden" id="id" value="<? print $id; ?>">
</p>
</form>
<p> </p>
</body>
</html>