Notice: Undefined index:
Posted: Thu Mar 02, 2006 6:31 am
Hey Guys
Can anyone see where im going wrong here??
This is the error im getting
Notice: Undefined index: Update in c:\website\quality_management\incident_log\edit.php on line 142
Can anyone see where im going wrong here??
This is the error im getting
Notice: Undefined index: Update in c:\website\quality_management\incident_log\edit.php on line 142
Code: Select all
<?
$logid = $_GET['logid'];
$db_table = "incidentlog";
$query = "SELECT `logid`, `source`, `type`, `logtime`, `logtext` from `$db_table` WHERE `logid` ='$logid'" or die ("Could Not Run Query");
$result = mysql_query($query);
$get_info = mysql_fetch_array($result)
?>
<form action="<? echo($_SERVER['PHP_SELF']); ?>" method=POST>
<table width="129%" border="0">
<tr>
<td width="68"><strong>LogID:</strong></td>
<td colspan="9"><input type="TEXT" name="logid" size=150 value="<? echo($get_info["logid"]); ?>">
</td>
</tr>
<tr>
<td> </td>
<td colspan="9"> </td>
</tr>
<tr width="100%">
<?
$source = array("APP1",
"APP2",
"APP3",
"APP4");
# probably "nicer" to get above list of names from a database table?
echo <<<EOD
<td><strong>Source:</strong></td>
<td><select name="source" id="source">
EOD;
# add each eng as an option:
foreach($source as $value)
{
$selected = "";
if($value == $get_info["source"])
{
# mark this one as the selected entry:
$selected = " selected";
}
echo "<option$selected>$value</option>\n";
}
echo <<<EOD
</select></td>
EOD;
?>
<?
$type = array("Event",
"Warning",
"Error");
# probably "nicer" to get above list of names from a database table?
echo <<<EOD
<td><strong>Type:</strong></td>
<td><select name="type" id="type">
EOD;
# add each eng as an option:
foreach($type as $value)
{
$selected = "";
if($value == $get_info["type"])
{
# mark this one as the selected entry:
$selected = " selected";
}
echo "<option$selected>$value</option>\n";
}
echo <<<EOD
</select></td>
EOD;
?>
<td><strong>Time:</strong></td>
<td width="130">
<input name="logtime" type="TEXT" id="cal-field-1" value="<? echo($get_info["logtime"]); ?>" size="10" />
<button type="submit" id="cal-button-1">...</button>
<script type="text/javascript">
Calendar.setup({
inputField : "cal-field-1",
button : "cal-button-1",
align : "Tr"
});
</script>
</td>
</tr>
<tr>
<td> </td>
<td colspan="9"> </td>
</tr>
<tr>
<td><strong>Description:</strong></td>
<td colspan="9"><textarea class="textarea" name="logtext" rows=8 cols=150><? echo($get_info["logtext"]); ?></textarea></td>
</tr>
<tr>
<td> </td>
<td colspan="9"> </td>
</tr>
<tr>
<td> </td>
<td colspan="6"><input name="Update" type=SUBMIT class="button" id="Update2" value="Update">
<input name="Cancel" type="button" id="Cancel" onClick="MM_goToURL('parent','/quality_management/incident_log/incident_report.php');return document.MM_returnValue" value="Cancel"></td>
<td width="315" colspan="2"><div align="right"> </div></td>
</tr>
</table>
<br>
</form>
<?
if($_POST['Update'])
{
$query = "UPDATE `incidentlog` SET `source` = '". $_POST["source"] ."', `type` = '". $_POST["type"] ."', `logtime` = '".$_POST["logtime"]."', `logtext` = '".$_POST["logtext"]."' WHERE `logid` = '$logid'";
$result = mysql_query($query);
if(!@header("Location: incident_report.php")){
echo("<META HTTP-EQUIV=Refresh CONTENT=\"1; URL=incident_report.php\">");
echo("<script>
window.top.location.href = 'incident_report.php';
</script>");
echo("You should now be redirected to the home page, click <a
href='incident_report.php'>here</a> if you are not redirected.");
};
}
?>