Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['btn-upload']))
- {
- $pic = rand(100000,10000000)."-".$_FILES['file']['name'];
- $pic_loc = $_FILES['file']['tmp_name'];
- $folder="movies/";
- if(move_uploaded_file($pic_loc,$folder.$pic))
- {
- ?><script>alert('Success.');</script><?php
- }
- else
- {
- ?><script>alert('Failure.');</script><?php
- }
- }
- ?>
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Movie Uploader</title>
- <link href='https://fonts.googleapis.com/css?family=Dosis:200' rel='stylesheet' type='text/css'>
- <style type="text/css">
- body, html {
- width: 100%;
- height:100%;
- margin: 0;
- font-family: 'Dosis', sans-serif;
- }
- .container {
- width: 100%;
- height: 100%;
- text-align: center;
- display: table;
- }
- .center {
- display: table-cell;
- vertical-align: middle;
- }
- </style>
- </head>
- <body>
- <div class="container">
- <div class="center">
- <form action="" method="post" enctype="multipart/form-data">
- <img src="logo.png" draggable="false">
- <h2>Upload those sexy movies</h2> <br><br>
- <input type="file" name="file" />
- <button type="submit" name="btn-upload">Upload</button>
- </form>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement