Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Upload File</title>
- </head>
- <body>
- Silahkan upload file disini :
- <form action="form4.php" method="POST" enctype="multipart/form-data">
- <input type="file" name="gambar">
- <input type="submit" name="upload" value="upload">
- </form>
- </body>
- </html>
- <?php
- if (isset($_POST['upload'])) {
- echo "Disini akan ditampilkan hasil upload.<br/>";
- $gambar = $_FILES['gambar'];
- $namafile = uniqid().$gambar['name'];
- move_uploaded_file($gambar['tmp_name'], $namafile);
- echo "<img src = '".$namafile."' width = 100px>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement