Viewing and Editing Tasks for a Project Management Application - HTML Form
(Page 4 of 4 )
The HTML form is exactly the same as the form used in the add_task.php script, except the form fields now have the values from the query. So when you see the form, all the information about the task that you want to change will already be on it. I've highlighted those values:
<!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"><!-- InstanceBegin template="/Templates/PM_Main.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<link href="Templates/main.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="100%" border="0">
<tr>
<td width="33%"> </td>
<td width="28%"> </td>
<td width="39%">Logged in: <!-- InstanceBeginEditable name="login" --><? echo $_SESSION['name'];?> | <a href="logout.php">Logout</a><!-- InstanceEndEditable --></td>
</tr>
<tr>
<td colspan="3" bgcolor="#6699CC" class="headertxt">Project Management Software </td>
</tr>
<tr>
<td colspan="3"><!-- InstanceBeginEditable name="main" -->
<form id="form1" name="form1" method="post" action="edit_task.php">
<table width="100%" border="0">
<tr>
<td colspan="2" class="loginheader"><?php echo $title;?></td>
</tr>
<tr>
<td width="14%"> </td>
<td width="86%"> </td>
</tr>
<tr>
<td valign="top">Description</td>
<td><label>
<textarea name="descr"><?php echo $rowtask['task_description'];?></textarea>
</label></td>
</tr>
<tr>
<td valign="top">Complete by: </td>
<td><label>
<?
$dd = date("d");
$mm = date("m");
$yy = date("Y");
echo "<select name="dd">n";
for($i = 1; $i <= 31; $i++) {
echo "<option value="" . $i . """;
if($i == $dd) {
echo " selected";
}
echo ">" . $i . "</option>n";
}
echo "</select> <select name="mm">n";
for($i = 1; $i <= 12; $i++) {
echo "<option value="" . $i . """;
if($i == $mm) {
echo " selected";
}
echo ">" . $month_names[$i] . "</option>n";
}
echo "</select> <select name="yy">n";
for($i = $yy; $i <= ($yy + 1); $i++) {
echo "<option value="" . $i . """;
if($i == $yy) {
echo " selected";
}
echo ">" . $i . "</option>n";
}
echo "</select>";
?>
</label>
<input name="p_pid" type="hidden" value="<?php echo $_GET['pid']?>" /></td>
</tr>
<tr>
<td> </td>
<td><label>
<input name="submit" type="submit" id="submit" value="Update Task" />
</label></td>
</tr>
</table>
</form>
<!-- InstanceEndEditable --></td>
</tr>
<tr>
<td colspan="3"><!-- InstanceBeginEditable name="nav" --><table width="100%" border="0">
<tr>
<td><a href="main.php">View Project List</a> | <a href="admin/login.php">Administrators Corner </a></td>
</tr>
</table><!-- InstanceEndEditable --></td>
</tr>
<tr>
<td align="right" class="cright" colspan="3">copyright © 2007 PM </td>
</tr>
</table>
</body>
<!-- InstanceEnd --></html>
That's it for now. Be sure to check in for the next article of the series.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |