Advertisement
Guest User

Untitled

a guest
Oct 19th, 2011
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.00 KB | None | 0 0
  1. <form method="post"
  2.         enctype="multipart/form-data">
  3.         <table width="384" border="0" align="center" cellpadding="0" cellspacing="0">
  4.         <tr>
  5.         <td width="104"><label for="file">Fil-upload:</label>
  6.         <br /></td>
  7.         <td width="270"><input type="file" name="file" id="file" /></td>
  8.         </tr>
  9.         <tr>
  10.         <td>&nbsp;</td>
  11.         <td><input type="submit" name="submit" value="Upload" /></td>
  12.         </tr>
  13.         </table>
  14.     </form>
  15.     <br />
  16.         <?php
  17.         if ($_FILES["file"]["size"] < 5000000000)
  18.           {
  19.          
  20.             move_uploaded_file($_FILES["file"]["tmp_name"],
  21.             "upload2/" . $_GET[id] . "/" . $_FILES["file"]["name"]);
  22.             $b="Stored in: " . "http://www....dk/upload2/" . $_GET[id] . "/" . $_FILES["file"]["name"];
  23.             $a="http://www....dk/upload2/" . $_GET[id] . "/" . $_FILES["file"]["name"];
  24.             //echo "<table border=0 cellspacing=0 cellpading=0 width=384 align=center>
  25.             //<tr> <td>Fil uploadet!</td></tr>
  26.             //<tr> <td><font color=blue>$b</td></tr>
  27.             //<tr> <td><font color=blue><a href=$a>Link</a></td></tr>
  28.             //</table>";
  29.            
  30.           }
  31.         else
  32.           {
  33.           echo "Filen er for stor";
  34.           }
  35.         ?>
  36.   <br /><br /><br />
  37.   <table>
  38.   <tr>
  39.   <td class="fld_ttl">
  40.     <?php echo "$_GET[id]" . ":"; ?>
  41.     </td>
  42.     </tr>
  43.     </table>
  44.     <div class="submit_small">
  45.        
  46.         <br />
  47.         <table width="100%" border="0" cellspacing="2" cellpadding="2">
  48.  
  49.         <?php
  50.         $dir = "./upload2/" . nl2br($_GET[id]);
  51.        
  52.         if (is_dir($dir)) {
  53.             if ($dh = opendir($dir)) {
  54.                 while (($file = readdir($dh)) !== false) {
  55.                     $bleh = "http://www....dk/upload2/" . $_GET[id] . "/" . $file;
  56.                     if ($file != "." && $file != "..") {
  57.                     ?>
  58.                     <tr>
  59.                     <td class="table_nice">
  60.                     <?
  61.                         echo "<a href=$bleh>$file</a>" . '<br />';
  62.                     }
  63.                     ?>
  64.                     </td>
  65.                     </tr>
  66.                  <?
  67.                 }
  68.                 closedir($dh);
  69.             }
  70.         }
  71.         ?>
  72.         </table>
  73.  
  74.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement