01.
<?php
02.
session_start();
03.
if
(
$_SESSION
[
'username'
] ==
""
)
04.
{
05.
echo
"Please Login!"
;
06.
exit
();
07.
}
08.
09.
mysql_connect(
"localhost"
,
"root"
,
"1234"
);
10.
mysql_select_db(
"maintendb"
);
11.
$strSQL
=
"select * from membertbl where username = '"
.
$_SESSION
['username
']."'
";
12.
$objQuery
= mysql_query(
$strSQL
);
13.
$objResult
= mysql_fetch_array(
$objQuery
);
14.
?>
15.
<html>
16.
<head>
17.
<title>ระบบจัดการงานซ่อมบำรุง</title>
18.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
></head>
19.
<body>
20.
<form name=
"form1"
method=
"post"
action=
"save_edit_member.php"
>
21.
แก้ไขข้อมูลส่วนตัว <br>
22.
<table width=
"400"
border=
"1"
style=
"width: 400px"
>
23.
<tbody>
24.
<tr>
25.
<td width=
"125"
> รหัสบัตรประชาชน</td>
26.
<td width=
"180"
>
27.
<?php
echo
$objResult
[
"people_id"
];?>
28.
</td>
29.
</tr>
30.
<tr>
31.
<td width=
"125"
> ชื่อผู้ใช้</td>
32.
<td width=
"180"
>
33.
<?php
echo
$objResult
[
"people_name"
];?>
34.
</td>
35.
</tr>
36.
<tr>
37.
<td> Username</td>
38.
<td><input name=
"username"
type=
"text"
id=
"username"
value=
"<?php echo $objResult["
username
"];?>"
>
39.
</td>
40.
</tr>
41.
<tr>
42.
<td> Password</td>
43.
<td><input name=
"password"
type=
"password"
id=
"password"
value=
"<?php echo $objResult["
password
"];?>"
>
44.
</td>
45.
</tr>
46.
<tr>
47.
<td> Confirm Password</td>
48.
<td><input name=
"conpassword"
type=
"password"
id=
"conpassword"
value=
"<?php echo $objResult["
password
"];?>"
>
49.
</td>
50.
</tr>
51.
<tr>
52.
<td> ที่อยู่</td>
53.
<td><input name=
"address"
type=
"text"
id=
"address"
value=
"<?php echo $objResult["
address
"];?>"
>
54.
</td>
55.
</tr>
56.
<tr>
57.
<td> เบอร์โทรศัพท์</td>
58.
<td><input name=
"tel"
type=
"text"
id=
"tel"
value=
"<?php echo $objResult["
tel
"];?>"
></td>
59.
</tr>
60.
<tr>
61.
<td> Email</td>
62.
<td><input name=
"email"
type=
"text"
id=
"email"
value=
"<?php echo $objResult["
email
"];?>"
></td>
63.
</tr>
64.
</tbody>
65.
</table>
66.
<br>
67.
<input type=
"submit"
name=
"Submit"
value=
"Save"
>
68.
</form>
69.
</body>
70.
</html>