ryuozero Site Admin
�������: 13 Jul 2005 �ͺ: 1145
|
�ͺ�����: Sun Sep 27, 2009 3:18 pm ����ͧ: upload ������� |
|
|
��ҧ�ԧ�ҡ: |
<?
if($_POST['add']==1){
foreach($_FILES as $name => $file){
//echo 'input = '.$name.', file = '.$file['name'].', tmp_name = '.$file['tmp_name'].'<br>';
$path = "./uppic/"; //���˹觢ͧ������ ����ͧ��������
move_uploaded_file($file['tmp_name'],$path.$file['name']);
// mysql_query("insert into tb_name () values () ");
}
}
?>
<HTML>
<HEAD>
<TITLE>upload</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-874">
</HEAD>
<BODY>
<FORM name="F1" onSubmit="" action="<?=$PHP_SELF;?>"
method="post" encType="multipart/form-data">
<INPUT type="hidden" name="add" id="add" value="1">
<SCRIPT language="javascript" type="text/javascript">
var n = 1;
var w = 1;
function mknormal(){
w = 1;
n = 1;
document.getElementById("tx").innerHTML= '<input name="file1" type="file" /><br />';
//document.F1.action = "";
}
function plus(){
if (w==1) { plusnormal(); }
if (w==2 && n<5){ plusremote(); }
}
function plusremote() {
n = n+1;
var main = document.getElementById("tx");
document.getElementById("dasminus").style.visibility='visible';
document.getElementById("dasminus").style.fontSize='20px';
var newnode = document.createElement("input");
newnode.type="text";
newnode.name="link";
main.appendChild(newnode);
main.appendChild(document.createElement("br"));
}
function plusnormal() {
n = n+1;
document.getElementById("dasminus").style.visibility='visible';
document.getElementById("dasminus").style.fontSize='20px';
var main = document.getElementById("tx");
var newnode = document.createElement("input");
newnode.type="file";
newnode.name="file"+n;
main.appendChild(newnode);
main.appendChild(document.createElement("br"));
}
function minus() {
if (n>1) {
n = n-1;
var main = document.getElementById("tx");
main.removeChild(main.lastChild);
main.removeChild(main.lastChild);
}
if (n==1){
document.getElementById("dasminus").style.visibility='hidden';
document.getElementById("dasminus").style.fontSize='1px';
}
}
</SCRIPT>
<TABLE width="100%" border="0" style="MARGIN-BOTTOM: 0px">
<TBODY>
<TR>
<TD width="50" align="center" valign="top">
<A href="javascript:plus();" style="color:#009900; font-size:20px;
font-weight:bold; text-decoration:none;">+ </A>
</TD>
<TD width="705" rowSpan="2" valign="top">
<DIV id="tx"><!--<script language="javascript">mknormal();</script>-->
<input name="file1" type="file" /><br /></DIV>
</TD>
</TR>
<TR>
<TD align="center" valign="bottom">
<DIV id="dasminus" style="visibility:hidden;">
<A style="color:#FF0000; font-size:20px; font-weight:bold;
text-decoration:none;" href="javascript:minus();">- </A>
</DIV>
</TD>
</TR>
</TBODY>
</TABLE>
<input name="submit" type="submit" value="upload...">
<input name="reset" type="button" value="refresh" onClick="window.location.href='upload.php';">
</FORM>
</BODY>
</HTML>
��ѧ��Ҥ��١㨹� |
|
|