01.
{
02.
for
(
$i
=0;
$i
<
count
(
$_FILES
[
"txtSimg"
][
"name"
]);
$i
++)
03.
{
04.
if
(
$_FILES
[
"txtSimg"
][
"name"
][
$i
] !=
""
)
05.
{
06.
if
(move_uploaded_file(
$_FILES
[
"txtSimg"
][
"tmp_name"
][
$i
],
"imgs/"
.
$_FILES
[
"txtSimg"
][
"name"
][
$i
]))
07.
{
08.
09.
$strSQL
=
"INSERT INTO files "
;
10.
$strSQL
.=
"(FilesName) VALUES ('"
.
$_FILES
[
"txtSimg"
][
"name"
][
$i
].
"')"
;
11.
$objQuery
= mysql_query(
$strSQL
);
12.
}
13.
}
14.
}
15.
if
(move_uploaded_file(
$_FILES
[
"txtBimg"
][
"tmp_name"
],
"imgs/"
.
$_FILES
[
"txtBimg"
][
"name"
]));
16.
$strSQL
=
"INSERT INTO board (title,room,bimg,details) VALUES ('"
.
$_POST
[
"txtTitle"
]."',
17.
'".$_POST["txtRoom"]."'
,
18.
'".$_FILES["txtBimg"]["name"]."'
,
19.
'".$_POST["txtDetails"]."'
)";
20.
$objQuery
= mysql_query(
$strSQL
);
21.
22.
echo
".....<br>"
;
23.
24.
echo
"<br> Go to <a href='index.php'>กลับ</a>"
;
25.
26.
}