Update of /cvsroot/openfirst/photogallery/admin
In directory sc8-pr-cvs1:/tmp/cvs-serv14561
Modified Files:
upload.php
Log Message:
Added blank upload field checking.
Index: upload.php
===================================================================
RCS file: /cvsroot/openfirst/photogallery/admin/upload.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** upload.php 20 Aug 2003 19:04:07 -0000 1.2
--- upload.php 21 Aug 2003 14:18:56 -0000 1.3
***************
*** 48,51 ****
--- 48,55 ----
for ($num=1;$num<=$_POST['NUM_UPLOADS'];$num++){
+ // If upload field is empty then exit the particular loop
+
+ if (! $_FILES['upload'.$num]['name'] == ""){
+
$continue = false;
***************
*** 67,71 ****
}
! if (! $_FILES['upload'.$num]['name'] == ""){
copy($_FILES['upload'.$num]['tmp_name'], $dirlocate."/".$_FILES['upload'.$num]['name']) or $error = true;
echo "<center><br>".$_FILES['upload'.$num]['name']." - ".$_FILES['upload'.$num]['size']." - ".$_FILES['upload'.$num]['type']." - ";
--- 71,75 ----
}
!
copy($_FILES['upload'.$num]['tmp_name'], $dirlocate."/".$_FILES['upload'.$num]['name']) or $error = true;
echo "<center><br>".$_FILES['upload'.$num]['name']." - ".$_FILES['upload'.$num]['size']." - ".$_FILES['upload'.$num]['type']." - ";
***************
*** 76,81 ****
echo "<font color='Red'>Not Successful</font><br></center>\n";
}
!
! }
}
}
--- 80,84 ----
echo "<font color='Red'>Not Successful</font><br></center>\n";
}
! }
}
}
***************
*** 93,97 ****
</a> <a href="upload.php?ID=<?php echo $_GET['ID']; ?>">Upload Photos</a>
<a href="cleargallery.php?ID=<?php echo $_GET['ID']; ?>">Clear Gallery</a> </p>
! <p align="center">Current Files Allowd: <?php echo $imgtypes; ?></p>
<p align="center">
<form action='upload.php?ID=<?php echo $_GET['ID']; ?>' enctype="multipart/form-data" method='POST'>
--- 96,100 ----
</a> <a href="upload.php?ID=<?php echo $_GET['ID']; ?>">Upload Photos</a>
<a href="cleargallery.php?ID=<?php echo $_GET['ID']; ?>">Clear Gallery</a> </p>
! <p align="center">Current Files Allowed: <?php echo $imgtypes; ?></p>
<p align="center">
<form action='upload.php?ID=<?php echo $_GET['ID']; ?>' enctype="multipart/form-data" method='POST'>
|