寫一個 PHP 網頁上傳範例
請先關閉 SELinux # yum install php # vi /etc/php.ini upload_max_filesize = 1000M post_max_size = 1000M max_execution_time = 36000 # md /var/www/html/upload # cd /var/www/html # chmod -R 777 /var/www/html/upload # chown apache:apache /var/www/html/upload # cd /var/www/html/upload # firewall-cmd --add-service=http --permanent # firewall-cmd --reload # vi file.php 程式碼: ------------------------------------------------------------------------- <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>檔案上傳</title> </head> <body> <form action="file.php" method="POST" enctype="multipart/form-data" name="form1" id="form1"> <table> <tr> <td align="left"> <?php $fileNum=1; for($i=0;$i<$fileNum;$i++){?> <p>附加檔案<?php echo $i+1;?>: <input type="file" name="file[]" /> </