初心者用フォームスケルトン : ファイルアップロード 拡張子:txtvbswsfjsphpjavahtmlutf8sjis <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>初心者用フォームスケルトン : SQL、メール、Twitter</title> <script type="text/javascript"> function resetIframe() { var ifdoc = document.getElementById("result").contentWindow.document; ifdoc.write(""); ifdoc.close(); } </script> </head> <body> <div style='position:relative;padding:10px;'> <span style='font-size:20px;'>初心者用フォームスケルトン</span> <input type="button" value="結果をリセット" onclick='resetIframe();' style='position:relative;top:-3px;' /> <input type="button" value="ページリセット" onclick='location="form.htm"' style='position:relative;top:-3px;' /> <br><br> <table style='width:100%'><tr> <td style='width:1px;vertical-align:top;width:300px;'> <form enctype="multipart/form-data" action="upload1.php" method="POST" target="result" style='display:inline;' > <input type="hidden" name="MAX_FILE_SIZE" value="100000"> <input type="file" id="file_1" name="file_1" size="40" /> <br> <input type="submit" value="単フィールド単ファイルアップロード" /> <br /> <br /> </form> <form enctype="multipart/form-data" action="upload2.php" method="POST" target="result" style='display:inline;' > <input type="hidden" name="MAX_FILE_SIZE" value="100000"> <input type="file" id="file_1" name="file_1" size="40" /> <br> <input type="file" id="file_2" name="file_2" size="40" /> <br> <input type="submit" value="複フィールド複ファイルアップロード" /> <br /> <br /> </form> <form enctype="multipart/form-data" action="upload3.php" method="POST" target="result" style='display:inline;' > <input type="hidden" name="MAX_FILE_SIZE" value="100000"> multiple="true"<br> <input type="file" id="file_1" name="file_up[]" size="40" multiple="true" /> <br> <input type="submit" value="単フィールド複ファイルアップロード" /> <br /> <br /> </form> </td><td> <iframe id="result" name="result" frameborder="1" scrolling="yes" style='width:100%;height:700px;' ></iframe> </td> </tr> </table> </div> </body> </html>
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>初心者用フォームスケルトン : SQL、メール、Twitter</title> <script type="text/javascript"> function resetIframe() { var ifdoc = document.getElementById("result").contentWindow.document; ifdoc.write(""); ifdoc.close(); } </script> </head> <body> <div style='position:relative;padding:10px;'> <span style='font-size:20px;'>初心者用フォームスケルトン</span> <input type="button" value="結果をリセット" onclick='resetIframe();' style='position:relative;top:-3px;' /> <input type="button" value="ページリセット" onclick='location="form.htm"' style='position:relative;top:-3px;' /> <br><br> <table style='width:100%'><tr> <td style='width:1px;vertical-align:top;width:300px;'> <form enctype="multipart/form-data" action="upload1.php" method="POST" target="result" style='display:inline;' > <input type="hidden" name="MAX_FILE_SIZE" value="100000"> <input type="file" id="file_1" name="file_1" size="40" /> <br> <input type="submit" value="単フィールド単ファイルアップロード" /> <br /> <br /> </form> <form enctype="multipart/form-data" action="upload2.php" method="POST" target="result" style='display:inline;' > <input type="hidden" name="MAX_FILE_SIZE" value="100000"> <input type="file" id="file_1" name="file_1" size="40" /> <br> <input type="file" id="file_2" name="file_2" size="40" /> <br> <input type="submit" value="複フィールド複ファイルアップロード" /> <br /> <br /> </form> <form enctype="multipart/form-data" action="upload3.php" method="POST" target="result" style='display:inline;' > <input type="hidden" name="MAX_FILE_SIZE" value="100000"> multiple="true"<br> <input type="file" id="file_1" name="file_up[]" size="40" multiple="true" /> <br> <input type="submit" value="単フィールド複ファイルアップロード" /> <br /> <br /> </form> </td><td> <iframe id="result" name="result" frameborder="1" scrolling="yes" style='width:100%;height:700px;' ></iframe> </td> </tr> </table> </div> </body> </html>
拡張子:txtvbswsfjsphpjavahtmlutf8sjis <? header( "Content-Type: text/html; Charset=utf-8" ); header( "pragma: no-cache" ); header( "Expires: Wed, 31 May 2000 14:59:58 GMT" ); header( "Cache-control: no-cache" ); foreach( $_POST as $Key => $Value ) { $_POST[$Key] = str_replace("\\\\", "\\", $Value ); $_POST[$Key] = str_replace("\\'", "'", $_POST[$Key] ); $_POST[$Key] = str_replace("\\\"", "\"", $_POST[$Key] ); } print "<pre>"; print_r( $_FILES ); print "</pre>"; $target = $_FILES['file_1']['name']; $upload = "./upload_file/"; $upload .= $target; print $upload . "<br>"; if ( move_uploaded_file( $_FILES['file_1']['tmp_name'], $upload ) ) { print "アップロードに成功しました\n"; } else { print "アップロードに失敗しました\n"; } ?>
<? header( "Content-Type: text/html; Charset=utf-8" ); header( "pragma: no-cache" ); header( "Expires: Wed, 31 May 2000 14:59:58 GMT" ); header( "Cache-control: no-cache" ); foreach( $_POST as $Key => $Value ) { $_POST[$Key] = str_replace("\\\\", "\\", $Value ); $_POST[$Key] = str_replace("\\'", "'", $_POST[$Key] ); $_POST[$Key] = str_replace("\\\"", "\"", $_POST[$Key] ); } print "<pre>"; print_r( $_FILES ); print "</pre>"; $target = $_FILES['file_1']['name']; $upload = "./upload_file/"; $upload .= $target; print $upload . "<br>"; if ( move_uploaded_file( $_FILES['file_1']['tmp_name'], $upload ) ) { print "アップロードに成功しました\n"; } else { print "アップロードに失敗しました\n"; } ?>
拡張子:txtvbswsfjsphpjavahtmlutf8sjis <? header( "Content-Type: text/html; Charset=utf-8" ); header( "pragma: no-cache" ); header( "Expires: Wed, 31 May 2000 14:59:58 GMT" ); header( "Cache-control: no-cache" ); foreach( $_POST as $Key => $Value ) { $_POST[$Key] = str_replace("\\\\", "\\", $Value ); $_POST[$Key] = str_replace("\\'", "'", $_POST[$Key] ); $_POST[$Key] = str_replace("\\\"", "\"", $_POST[$Key] ); } print "<pre>"; print_r( $_FILES ); print "</pre>"; foreach( $_FILES as $Key => $Value ) { $target = $_FILES[$Key]['name']; $upload = "./upload_file/"; $upload .= $target; print $upload . "<br>"; if ( move_uploaded_file( $_FILES[$Key]['tmp_name'], $upload ) ) { print "アップロードに成功しました<br>\n"; } else { print "アップロードに失敗しました<br>\n"; } } ?>
<? header( "Content-Type: text/html; Charset=utf-8" ); header( "pragma: no-cache" ); header( "Expires: Wed, 31 May 2000 14:59:58 GMT" ); header( "Cache-control: no-cache" ); foreach( $_POST as $Key => $Value ) { $_POST[$Key] = str_replace("\\\\", "\\", $Value ); $_POST[$Key] = str_replace("\\'", "'", $_POST[$Key] ); $_POST[$Key] = str_replace("\\\"", "\"", $_POST[$Key] ); } print "<pre>"; print_r( $_FILES ); print "</pre>"; foreach( $_FILES as $Key => $Value ) { $target = $_FILES[$Key]['name']; $upload = "./upload_file/"; $upload .= $target; print $upload . "<br>"; if ( move_uploaded_file( $_FILES[$Key]['tmp_name'], $upload ) ) { print "アップロードに成功しました<br>\n"; } else { print "アップロードに失敗しました<br>\n"; } } ?>
拡張子:txtvbswsfjsphpjavahtmlutf8sjis <? header( "Content-Type: text/html; Charset=utf-8" ); header( "pragma: no-cache" ); header( "Expires: Wed, 31 May 2000 14:59:58 GMT" ); header( "Cache-control: no-cache" ); foreach( $_POST as $Key => $Value ) { $_POST[$Key] = str_replace("\\\\", "\\", $Value ); $_POST[$Key] = str_replace("\\'", "'", $_POST[$Key] ); $_POST[$Key] = str_replace("\\\"", "\"", $_POST[$Key] ); } print "<pre>"; print_r( $_FILES ); print "</pre>"; foreach( $_FILES['file_up'][name] as $Key => $Value ) { $target = $_FILES['file_up']['name'][$Key]; $upload = "./upload_file/"; $upload .= $target; print $upload . "<br>"; if ( move_uploaded_file( $_FILES['file_up']['tmp_name'][$Key], $upload ) ) { print "アップロードに成功しました<br>\n"; } else { print "アップロードに失敗しました<br>\n"; } } ?>
<? header( "Content-Type: text/html; Charset=utf-8" ); header( "pragma: no-cache" ); header( "Expires: Wed, 31 May 2000 14:59:58 GMT" ); header( "Cache-control: no-cache" ); foreach( $_POST as $Key => $Value ) { $_POST[$Key] = str_replace("\\\\", "\\", $Value ); $_POST[$Key] = str_replace("\\'", "'", $_POST[$Key] ); $_POST[$Key] = str_replace("\\\"", "\"", $_POST[$Key] ); } print "<pre>"; print_r( $_FILES ); print "</pre>"; foreach( $_FILES['file_up'][name] as $Key => $Value ) { $target = $_FILES['file_up']['name'][$Key]; $upload = "./upload_file/"; $upload .= $target; print $upload . "<br>"; if ( move_uploaded_file( $_FILES['file_up']['tmp_name'][$Key], $upload ) ) { print "アップロードに成功しました<br>\n"; } else { print "アップロードに失敗しました<br>\n"; } } ?>