01.
<?PHP
02.
include
(
'include/function.php'
);
03.
?>
04.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
05.
<?php
06.
07.
08.
09.
10.
11.
12.
if
(move_uploaded_file(
$_FILES
[
"fileUpload"
][
"tmp_name"
],
"myfile/"
.
$_FILES
[
"fileUpload"
][
"name"
]))
13.
{
14.
echo
"<script>alert('เพิ่มไฟล์เรียบร้อย');window.location=\"tag_details_durable.php?tag_du_id=$_POST[tag_du_id]\";</script>"
;
15.
16.
17.
$objConnect
= mysql_connect(
"localhost"
,
"root"
,
""
)
or
die
(
"Error Connect to Database"
);
18.
mysql_query(
"SET character_set_results=utf8"
);
19.
mysql_query(
"SET character_set_client=utf8"
);
20.
mysql_query(
"SET character_set_connection=utf8"
);
21.
$objDB
= mysql_select_db(
"work"
);
22.
$strSQL
=
"INSERT INTO `work`.`work_du_file`"
;
23.
$strSQL
.=
"(`file_du_id`, `file_du_name`, `tag_du_id`, `file_du_detail`, `last_update`) VALUES ('"
.
$_POST
[
"file_du_id"
].
"','"
.
$_FILES
[
"fileUpload"
][
"name"
].
"','"
.
$_REQUEST
[
"tag_du_id"
].
"','"
.
$_POST
[
"file_du_detail"
].
"',now())"
;
24.
$objQuery
= mysql_query(
$strSQL
);
25.
26.
}
27.
?>