Advertisement
Guest User

hmmmm

a guest
Jan 4th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.66 KB | None | 0 0
  1. <?php
  2. if(isset($_POST['btn-upload']))
  3. {
  4.      $pic = rand(100000,10000000)."-".$_FILES['file']['name'];
  5.     $pic_loc = $_FILES['file']['tmp_name'];
  6.      $folder="movies/";
  7.      if(move_uploaded_file($pic_loc,$folder.$pic))
  8.      {
  9.         ?><script>alert('Success.');</script><?php
  10.      }
  11.      else
  12.      {
  13.         ?><script>alert('Failure.');</script><?php
  14.      }
  15. }
  16.  
  17. ?>
  18. <!DOCTYPE html>
  19.  
  20. <html xmlns="http://www.w3.org/1999/xhtml">
  21.  
  22.     <head>
  23.  
  24.         <title>Movie Uploader</title>
  25.  
  26.         <link href='https://fonts.googleapis.com/css?family=Dosis:200' rel='stylesheet' type='text/css'>
  27.  
  28.         <style type="text/css">
  29.  
  30.             body, html {
  31.                 width: 100%;
  32.                 height:100%;
  33.                 margin: 0;
  34.                 font-family: 'Dosis', sans-serif;
  35.             }
  36.  
  37.             .container {
  38.                 width: 100%;
  39.                 height: 100%;
  40.                 text-align: center;
  41.                 display: table;
  42.             }
  43.  
  44.             .center {
  45.                 display: table-cell;
  46.                 vertical-align: middle;
  47.             }
  48.  
  49.         </style>
  50.  
  51.     </head>
  52.  
  53.     <body>
  54.  
  55.         <div class="container">
  56.  
  57.             <div class="center">
  58.  
  59.                 <form action="" method="post" enctype="multipart/form-data">
  60.  
  61.                     <img src="logo.png" draggable="false">
  62.  
  63.                     <h2>Upload those sexy movies</h2> <br><br>
  64.  
  65.                     <input type="file" name="file" />
  66.                     <button type="submit" name="btn-upload">Upload</button>
  67.  
  68.                 </form>
  69.  
  70.             </div>
  71.  
  72.         </div>
  73.  
  74.     </body>
  75. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement