Location: PHPKode > projects > Mozart > Mozart-0.0.4/updtype.php
<?
// called from: newtypes.php
// description: allows updates to the TYPES table
include("connect.inc");
include("reqlogin.inc");
include("userprefs.inc");

// if the user hit the UPDATE key, update the entry
if ($Update) {
    $TypesSQL = "UPDATE types SET type_name = '$TypeName' WHERE type_id = '$id'";
    $Types    = mysql_query($TypesSQL);
    $Message  = "Type Updated";
    include("newtypes.php");
    exit;
}

// get the entry to be updated
$CheckSQL = "SELECT type_name, type_source FROM types WHERE type_id=$id";
$Check    = mysql_query($CheckSQL);
$check    = mysql_fetch_array($Check);
$TypeSource = $check["type_source"];
$TypeName   = $check["type_name"];

?>
<html>
<title>Update Type <?echo $TypeName?></title>
<body bgcolor=<? echo $userdata["bgcolor"] ?> text=<? echo $userdata["txtcolor"]?>>
<?
include("links.inc");

printf("<form action=\"updtype.php?id=%s\" method=\"post\">", $id);
?>
<center>
<b>Update Type <?echo $TypeName?></title></b>
<table border=1 cellspacing=0 cellpadding=0>
<tr><th>Table</th>
<th>Type Name</th></tr>
<tr><td><?echo $TypeSource?></td>
<td><input type=text name=TypeName value="<?echo $TypeName?>"></td>
</tr>
</table>
<br>
<input type=submit name="Update" value="Update Type <?echo $TypeName?>">
</table>
</table>
</form>
<?
include("links.inc");
?>
</body>
</html>
Return current item: Mozart