-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtodoEditForm.php
More file actions
45 lines (39 loc) · 1.33 KB
/
todoEditForm.php
File metadata and controls
45 lines (39 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
session_start();
require("dbconnect.php");
$id = (int)$_GET['id'];
$sql = "select * from todo where id = $id;";
$result=mysqli_query($conn,$sql) or die("DB Error: Cannot retrieve message.");
$rs=mysqli_fetch_assoc($result);
if (! $rs) {
echo "no data found";
exit(0);
}
?>
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無標題文件</title>
</head>
<body>
<h1>Edit Task</h1>
<form method="post" action="todoUpdate.php">
<input type='hidden' name='id' value='<?php echo $id ?>'>
task title: <input name="title" type="text" id="title" value="<?php echo htmlspecialchars($rs['title']);?>" /> <br>
task description: <input name="msg" type="text" id="msg" value="<?php echo htmlspecialchars($rs['content']);?>" /> <br>
Urgent Level: <select name="urgent" type="select" id="urgent" />
<?php
echo "<option value='{$rs['urgent']}'>{$rs['urgent']}</option>";
?>
<option value='一般'>一般</option>
<option value='重要'>重要</option>
<option value='緊急'>緊急</option>
</select>
<br>
<input type="submit" name="Submit" value="送出" />
</form>
</tr>
</table>
</body>
</html>