01.
<html>
02.
<head>
03.
<title></title>
04.
<meta http-equiv=
"Content-Type"
content=
"text/html; charset=windows-874"
/>
05.
</head>
06.
<body>
07.
<?
08.
include
(
"../../connect_one.php"
);
09.
$id
=
$_POST
[
'id'
];
10.
$topic
=
$_POST
[
'topic'
];
11.
$dis
=
$_POST
[
'dis'
];
12.
$detail
=
$_POST
[
'detail'
];
13.
$date
=
date
(
"d-m-Y"
);
14.
for
(
$i
=0;
$i
<
count
(
$_FILES
[
"filUpload"
][
"name"
]);
$i
++)
15.
{
16.
if
(
$_FILES
[
"filUpload"
][
"name"
][
$i
] !=
""
)
17.
{
18.
if
(
copy
(
$_FILES
[
"filUpload"
][
"tmp_name"
][
$i
],
"images/"
.
$_FILES
[
"filUpload"
][
"name"
][
$i
]))
19.
{
20.
21.
$strSQL
=
"INSERT INTO news_event (id_news,topic,dis,detail,dates,cnt,numb) VALUES ('$id','$topic','$dis','$detail','$date','1','1')"
;
22.
echo
$strSQL
;
23.
mysql_query(
"SET names tis620"
);
24.
$objQuery
= mysql_query(
$strSQL
);
25.
26.
$strSQL
=
"INSERT INTO pic (picid,id_news,topic,pic) VALUES ('','$id','$topic','"
.
$_FILES
[
"filUpload"
][
"name"
][
$i
].
"')"
;
27.
28.
mysql_query(
"SET names tis620"
);
29.
$objQuery
= mysql_query(
$strSQL
);
30.
echo
$strSQL
;
31.
}
32.
}
33.
}
34.
echo
"Upload Complete<br>"
;
35.
echo
$strSQL
;
36.
?>
37.
</body>
38.
</html>