Advertisement
blivori

upload.php

Dec 16th, 2012
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.46 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4.    
  5.     <title>FileStore - Upload Files</title>
  6.     <link rel="stylesheet" href="./CSS/style.css" type="text/css" media="screen, projection" />
  7. </head>
  8.  
  9. <body>
  10.  
  11. <div id="wrapper">
  12.  
  13.     <header id="header">
  14.    
  15.    
  16.     <div id="header-content">
  17.         <strong><h1>FileStore</h1></strong> Upload multiple files at once!
  18.     </div>
  19.    
  20.     <div class="login-info" >
  21.    
  22.     <form action="?op=login" method="POST" action="login.php" >
  23.             Username: <input name="username" size="15">
  24.             Password: <input type="password" name="password" size="8">
  25.                       <input type="submit" value="Login">
  26.     </form>
  27.    
  28.     </div>
  29.    
  30.    
  31.     </header><!-- #header-->
  32.  
  33.     <section id="middle" align="center">
  34.  
  35.         <div id="container">
  36.        
  37.         <br><br>
  38.             <div id="content">
  39.                 <strong><h1>Upload files</h1></strong><br><br>
  40.                
  41.                 <div id="upload-file" >
  42.                
  43.                 <?php
  44.  
  45.                         if (isset($_FILES['files'])) {
  46.  
  47.                         echo "<div id='files_table'><table class='center'.><tr><td>";
  48.  
  49.                                 foreach($_FILES['files']['tmp_name'] as $key => $tmp_name){
  50.  
  51.                                 move_uploaded_file($tmp_name, "files/{$_FILES['files']['name'][$key]}");
  52.                                
  53.                                 echo $_FILES['files']['name'][$key], " uploaded.", "<br>";
  54.                                
  55.  
  56.                         }
  57.                         echo "</td></tr></table></div><br><br>";
  58.                         }
  59.  
  60.                 ?>
  61.                     <form action="" method="post" enctype="multipart/form-data">
  62.                    
  63.                             <h1> Select files to upload:</h1>
  64.                             <br>
  65.                             <p>
  66.                                 <input type="file" name ="files[]" multiple="multiple" min="1" />
  67.                                 <input type="submit" value="Upload" />
  68.                             </p>
  69.                             <br>
  70.                             <h2> You can select multiple files for upload. </h2>
  71.                    
  72.                     </form>
  73.            
  74.         </div>
  75.                                            
  76.             </div><!-- #content-->
  77.         </div><!-- #container-->
  78.  
  79.         <aside id="sideLeft">
  80.            
  81.             <div id="menu-x" align="center"><br>
  82.             <strong>Menu</strong><br><br>
  83.            
  84.                     <div class="menu">
  85.                         <ul>
  86.                         <li><a href="index.php">Home</a></li>
  87.                         <li><a href="upload.php">Upload</a></li>
  88.                         <li><a href="files.php">Files</a></li>
  89.                         <li><a href="about.php">About</a></li>
  90.                         <li><a href="help.php">Help</a></li>
  91.                         <li><a href="#">Logout</a></li>
  92.                         </ul>
  93.                         <br style="clear:left"/>
  94.                     </div>
  95.                    
  96.             </div>
  97.  
  98.            
  99.         </aside><!-- #sideLeft -->
  100.  
  101.     </section><!-- #middle-->
  102.  
  103.     <footer id="footer">
  104.         <strong>FileStore:</strong> A CMT 3315 Project by Brian Livori
  105.     </footer><!-- #footer -->
  106.  
  107. </div><!-- #wrapper -->
  108.  
  109. </body>
  110. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement