ホームページ バックエンド開発 PHPチュートリアル PHPコード サーバー側でのディレクトリの作成、削除、ファイルのアップロード、削除の処理を行うPHPコード

PHPコード サーバー側でのディレクトリの作成、削除、ファイルのアップロード、削除の処理を行うPHPコード

Jul 29, 2016 am 08:38 AM
PHPコード

extract($_GET);

;meta http-equiv="Content-Type" c text="#000000"> <br><form name="form1" method="post" action="<?php echo $_SERVER[PHP_SELF]; ?> ;"> <br><font color="#006633">入力ディレクトリ名: </font> <br><input type="text" name="InputDirRoot" value="<?=$InputDirRoot?> ;"> <br><input type="submit" name="Submit" value="このディレクトリの内容を表示"> <br></form> <br><form name="form1" method="post" action= "<?php echo $_SERVER[PHP_SELF]; ?>"> <br><input type=hidden name="method" value="createdir"> ;入力ディレクトリ名: </font> <br><input type="text" name="InputDir" value="<?=$InputDirRoot?>"> <br><input type="submit" name= "送信 " value="ディレクトリの作成" > <br></form> <br><form name="form1" method="post" action="<?php echo $_SERVER[PHP_SELF]; ?>" =" multipart/form-data"> <br><input type=hidden name="method" value="uploadfile"> アップロード ディレクトリ名: </font> <br><input type="text" name="InputDir" value="<?=$InputDirRoot?>">ファイルを選択してください: </font> ; <br><input type="file" name="アップロードファイル"><br></form> ="form1 " method="post" action="<?php echo $_SERVER[PHP_SELF]; ?>"> <br><input type=hidden name="method" value="drop"> ;font color ="#006633">次のように入力してください: </font> <br><input type="text" name="Info" value="<?=$InputDirRoot?>"> input type= "submit" name="Submit" value="ファイル/ディレクトリの削除"> <br><?php <BR>$n = 0; )) <BR> { <BR>$handle=opendir($InputDirRoot); <BR>echo "ディレクトリ リスト:<font color=#FF0000>".$InputDirRoot."</font><br><hr>"; while ($ file = readdir($handle)) <br>{ <br>$n ++; <br>if (is_dir($InputDirRoot."/".$file)) <br>$file = "<a href="$_SERVER[PHP_SELF] ]?InputDirRoot =$InputDirRoot/$file"><font color=#006600>[".$file."]</font></a>"; <br>else <br>$file = "<a href=" typefile.php?filename=$InputDirRoot/$file" target=_blank><font color=#993300>".$file."</font></a>"; <br>echo " "。 $file. "<br>"; <br>} <br>closedir($handle) <br>} <br>if(isset($method) && isset($InputDir) && strcmp($method,"createdir"){ // ディレクトリを作成します <br>if(is_dir($InputDir)){ <br>chmod($InputDir,0777); <br>echo "ディレクトリはすでに存在します!権限が変更されました!"; <br>}else{ <br>if(@mkdir("$InputDir")){ <br>echo "ディレクトリの作成が完了しました...!"; <br>}else{ <br>echo "ディレクトリの作成に失敗しました...!" ; <br>} <br>chmod($InputDir,0777); <br>} <br>} <br>if(isset($method) && isset($InputDir) && strcmp($method,"uploadfile")==0){//ファイルをアップロードまたは削除ファイル <br>if(is_file($InputDir."/".$_FILES[アップロードファイル][名前])){ <br>chmod($InputDir."/".$_FILES[アップロードファイル][名前],0777);存在する!削除されました! -- ファイルを再アップロードできます"; <br>unlink($InputDir."/".$_FILES[UploadFile][name]); <br>}else{ <br>if(@copy($_FILES[UploadFile][tmp_name] ] ,$InputDir."/".$_FILES[UploadFile][name])){ <br>echo "ファイル {$_FILES[UploadFile][name]} は {$InputDir} に正しくコピーされました...!"; } else{ <br>echo "ファイルのコピーに失敗しました...!"; <br>} <br>chmod($InputDir."/".$_FILES[アップロードファイル][名前],0777) <br>} <br>} <br>if(isset($Info) ) && strcmp($method,"drop")==0){// ファイルまたはディレクトリを削除 <br>if(is_dir($Info)){ <br>if(rmdir($Info)){ <br>echo "ディレクトリ {$Inof} delete 完了"; <br>}else{ <br>echo "ディレクトリは削除できません。理由は、ディレクトリにファイルがある可能性があります!"; <br>} <br>} <br>if(is_file($Info)){ <br>if(unlink($Info)){ <br>echo "ファイル {$Info} が削除されました。 .. !"; <br>}else{ <br>echo "ファイル {$Info} の削除に失敗しました...! 削除するファイルのアクセス許可を変更してみてください..."; <br>if(chmod($Info,0777)){ <br>unlink ($Info); <br>echo "ファイル {$Info} はアクセス許可を変更した後に削除されました..."; <br>}else{ <br>echo "ファイル {$Info} は WEB から削除できません。FTP アクセス許可が設定されている可能性があります。このファイルに設定されています..." ; <br>} <br>} <br>} <br>} <br>echo "<hr>"; <BR>echo "合計 $n 個の項目。"; <BR>?> <br></body> <br>< /html> </p> <p> 上記では、サーバー側でのディレクトリの作成、削除、ファイルのアップロード、削除のプロセスの PHP コードを紹介します。PHP コードの内容も含めて、PHP チュートリアルに興味のある友人の参考になれば幸いです。 </p> <p> </p> </div> </div> <div class="wzconShengming_sp"> <div class="bzsmdiv_sp">このウェブサイトの声明</div> <div>この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。</div> </div> </div> <ins class="adsbygoogle" style="display:block" data-ad-format="autorelaxed" data-ad-client="ca-pub-5902227090019525" data-ad-slot="2507867629"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> <div class="AI_ToolDetails_main4sR"> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-5902227090019525" data-ad-slot="3653428331" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> <!-- <div class="phpgenera_Details_mainR4"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hotarticle2.png" alt="" /> <h2>人気の記事</h2> </div> <div class="phpgenera_Details_mainR4_bottom"> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796785841.html" title="アサシンのクリードシャドウズ:シーシェルリドルソリューション" class="phpgenera_Details_mainR4_bottom_title">アサシンのクリードシャドウズ:シーシェルリドルソリューション</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3週間前</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796789525.html" title="Windows11 KB5054979の新しいものと更新の問題を修正する方法" class="phpgenera_Details_mainR4_bottom_title">Windows11 KB5054979の新しいものと更新の問題を修正する方法</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>2週間前</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796785857.html" title="Atomfallのクレーンコントロールキーカードを見つける場所" class="phpgenera_Details_mainR4_bottom_title">Atomfallのクレーンコントロールキーカードを見つける場所</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3週間前</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796781206.html" title="R.E.P.O.で節約説明した(そしてファイルを保存)" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O.で節約説明した(そしてファイルを保存)</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>1 か月前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796783009.html" title="アサシンクリードシャドウ - 鍛冶屋を見つけて武器と鎧のカスタマイズを解除する方法" class="phpgenera_Details_mainR4_bottom_title">アサシンクリードシャドウ - 鍛冶屋を見つけて武器と鎧のカスタマイズを解除する方法</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>4週間前</span> <span>By DDD</span> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/ja/article.html">もっと見る</a> </div> </div> </div> --> <div class="phpgenera_Details_mainR3"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hottools2.png" alt="" /> <h2>ホットAIツール</h2> </div> <div class="phpgenera_Details_mainR3_bottom"> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411540686492.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undresser.AI Undress" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/ai/undresserai-undress" title="Undresser.AI Undress" class="phpmain_tab2_mids_title"> <h3>Undresser.AI Undress</h3> </a> <p>リアルなヌード写真を作成する AI 搭載アプリ</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/ai/ai-clothes-remover" title="AI Clothes Remover" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411552797167.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="AI Clothes Remover" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/ai/ai-clothes-remover" title="AI Clothes Remover" class="phpmain_tab2_mids_title"> <h3>AI Clothes Remover</h3> </a> <p>写真から衣服を削除するオンライン AI ツール。</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/ai/undress-ai-tool" title="Undress AI Tool" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173410641626608.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Undress AI Tool" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/ai/undress-ai-tool" title="Undress AI Tool" class="phpmain_tab2_mids_title"> <h3>Undress AI Tool</h3> </a> <p>脱衣画像を無料で</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173411529149311.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="Clothoff.io" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/ai/clothoffio" title="Clothoff.io" class="phpmain_tab2_mids_title"> <h3>Clothoff.io</h3> </a> <p>AI衣類リムーバー</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/ai/ai-hentai-generator" title="AI Hentai Generator" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/ai_manual/001/246/273/173405034393877.jpg?x-oss-process=image/resize,m_fill,h_50,w_50" src="/static/imghw/default1.png" alt="AI Hentai Generator" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/ai/ai-hentai-generator" title="AI Hentai Generator" class="phpmain_tab2_mids_title"> <h3>AI Hentai Generator</h3> </a> <p>AIヘンタイを無料で生成します。</p> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/ja/ai">もっと見る</a> </div> </div> </div> <script src="https://sw.php.cn/hezuo/cac1399ab368127f9b113b14eb3316d0.js" type="text/javascript"></script> <div class="phpgenera_Details_mainR4"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hotarticle2.png" alt="" /> <h2>人気の記事</h2> </div> <div class="phpgenera_Details_mainR4_bottom"> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796785841.html" title="アサシンのクリードシャドウズ:シーシェルリドルソリューション" class="phpgenera_Details_mainR4_bottom_title">アサシンのクリードシャドウズ:シーシェルリドルソリューション</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3週間前</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796789525.html" title="Windows11 KB5054979の新しいものと更新の問題を修正する方法" class="phpgenera_Details_mainR4_bottom_title">Windows11 KB5054979の新しいものと更新の問題を修正する方法</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>2週間前</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796785857.html" title="Atomfallのクレーンコントロールキーカードを見つける場所" class="phpgenera_Details_mainR4_bottom_title">Atomfallのクレーンコントロールキーカードを見つける場所</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>3週間前</span> <span>By DDD</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796781206.html" title="R.E.P.O.で節約説明した(そしてファイルを保存)" class="phpgenera_Details_mainR4_bottom_title">R.E.P.O.で節約説明した(そしてファイルを保存)</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>1 か月前</span> <span>By 尊渡假赌尊渡假赌尊渡假赌</span> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/1796783009.html" title="アサシンクリードシャドウ - 鍛冶屋を見つけて武器と鎧のカスタマイズを解除する方法" class="phpgenera_Details_mainR4_bottom_title">アサシンクリードシャドウ - 鍛冶屋を見つけて武器と鎧のカスタマイズを解除する方法</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <span>4週間前</span> <span>By DDD</span> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/ja/article.html">もっと見る</a> </div> </div> </div> <div class="phpgenera_Details_mainR3"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hottools2.png" alt="" /> <h2>ホットツール</h2> </div> <div class="phpgenera_Details_mainR3_bottom"> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/toolset/development-tools/92" title="メモ帳++7.3.1" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab96f0f39f7357.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="メモ帳++7.3.1" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/toolset/development-tools/92" title="メモ帳++7.3.1" class="phpmain_tab2_mids_title"> <h3>メモ帳++7.3.1</h3> </a> <p>使いやすく無料のコードエディター</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/toolset/development-tools/93" title="SublimeText3 中国語版" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab97a3baad9677.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="SublimeText3 中国語版" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/toolset/development-tools/93" title="SublimeText3 中国語版" class="phpmain_tab2_mids_title"> <h3>SublimeText3 中国語版</h3> </a> <p>中国語版、とても使いやすい</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/toolset/development-tools/121" title="ゼンドスタジオ 13.0.1" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58ab97ecd1ab2670.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="ゼンドスタジオ 13.0.1" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/toolset/development-tools/121" title="ゼンドスタジオ 13.0.1" class="phpmain_tab2_mids_title"> <h3>ゼンドスタジオ 13.0.1</h3> </a> <p>強力な PHP 統合開発環境</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/toolset/development-tools/469" title="ドリームウィーバー CS6" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58d0e0fc74683535.jpg?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="ドリームウィーバー CS6" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/toolset/development-tools/469" title="ドリームウィーバー CS6" class="phpmain_tab2_mids_title"> <h3>ドリームウィーバー CS6</h3> </a> <p>ビジュアル Web 開発ツール</p> </div> </div> <div class="phpmain_tab2_mids_top"> <a href="https://www.php.cn/ja/toolset/development-tools/500" title="SublimeText3 Mac版" class="phpmain_tab2_mids_top_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" class="lazy" data-src="https://img.php.cn/upload/manual/000/000/001/58d34035e2757995.png?x-oss-process=image/resize,m_fill,h_50,w_72" src="/static/imghw/default1.png" alt="SublimeText3 Mac版" /> </a> <div class="phpmain_tab2_mids_info"> <a href="https://www.php.cn/ja/toolset/development-tools/500" title="SublimeText3 Mac版" class="phpmain_tab2_mids_title"> <h3>SublimeText3 Mac版</h3> </a> <p>神レベルのコード編集ソフト(SublimeText3)</p> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/ja/ai">もっと見る</a> </div> </div> </div> <div class="phpgenera_Details_mainR4"> <div class="phpmain1_4R_readrank"> <div class="phpmain1_4R_readrank_top"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/hotarticle2.png" alt="" /> <h2>ホットトピック</h2> </div> <div class="phpgenera_Details_mainR4_bottom"> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/gmailyxdlrkzn" title="Gmailメールのログイン入り口はどこですか?" class="phpgenera_Details_mainR4_bottom_title">Gmailメールのログイン入り口はどこですか?</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>7569</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>15</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/cakephp-tutor" title="CakePHP チュートリアル" class="phpgenera_Details_mainR4_bottom_title">CakePHP チュートリアル</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>1386</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>52</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/steamdzhmcssmgs" title="Steamのアカウント名の形式は何ですか" class="phpgenera_Details_mainR4_bottom_title">Steamのアカウント名の形式は何ですか</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>87</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>11</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/winactivationkeyper" title="Win11 Activation Key Permanent" class="phpgenera_Details_mainR4_bottom_title">Win11 Activation Key Permanent</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>61</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>19</span> </div> </div> </div> <div class="phpgenera_Details_mainR4_bottoms"> <a href="https://www.php.cn/ja/faq/newyorktimesdailybrief" title="NYTの接続はヒントと回答です" class="phpgenera_Details_mainR4_bottom_title">NYTの接続はヒントと回答です</a> <div class="phpgenera_Details_mainR4_bottoms_info"> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/eyess.png" alt="" /> <span>28</span> </div> <div class="phpgenera_Details_mainR4_bottoms_infos"> <img src="/static/imghw/tiezi.png" alt="" /> <span>107</span> </div> </div> </div> </div> <div class="phpgenera_Details_mainR3_more"> <a href="https://www.php.cn/ja/faq/zt">もっと見る</a> </div> </div> </div> </div> </div> <div class="Article_Details_main2"> <div class="phpgenera_Details_mainL4"> <div class="phpmain1_2_top"> <a href="javascript:void(0);" class="phpmain1_2_top_title">Related knowledge<img src="/static/imghw/index2_title2.png" alt="" /></a> </div> <div class="phpgenera_Details_mainL4_info"> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/602596.html" title="正規表現を使用して、最新のコード仕様を満たすように PHP コードをバッチ変更するにはどうすればよいですか?" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/000/164/169390065663885.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="正規表現を使用して、最新のコード仕様を満たすように PHP コードをバッチ変更するにはどうすればよいですか?" /> </a> <a href="https://www.php.cn/ja/faq/602596.html" title="正規表現を使用して、最新のコード仕様を満たすように PHP コードをバッチ変更するにはどうすればよいですか?" class="phphistorical_Version2_mids_title">正規表現を使用して、最新のコード仕様を満たすように PHP コードをバッチ変更するにはどうすればよいですか?</a> <span class="Articlelist_txts_time">Sep 05, 2023 pm 03:57 PM</span> <p class="Articlelist_txts_p">正規表現を使用して、最新のコード仕様を満たすように PHP コードをバッチ変更するにはどうすればよいですか?はじめに: 時間が経ち、テクノロジーが発展するにつれて、コード仕様は常に更新され、改善されます。開発プロセスでは、最新のコード仕様に準拠するために古いコードを変更する必要が生じることがよくあります。ただし、手動での変更は面倒で時間のかかる作業になる可能性があります。この場合、正規表現は強力なツールとなる可能性があります。正規表現を使用すると、コードをバッチで変更し、自動的に最新のコード仕様を満たすことができます。 1. 準備:使用する前に</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/590909.html" title="PHPコードテスト機能を利用してコードの保守性を向上させる方法" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/887/227/169172903167653.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="PHPコードテスト機能を利用してコードの保守性を向上させる方法" /> </a> <a href="https://www.php.cn/ja/faq/590909.html" title="PHPコードテスト機能を利用してコードの保守性を向上させる方法" class="phphistorical_Version2_mids_title">PHPコードテスト機能を利用してコードの保守性を向上させる方法</a> <span class="Articlelist_txts_time">Aug 11, 2023 pm 12:43 PM</span> <p class="Articlelist_txts_p">PHP コードのテスト機能を使用してコードの保守性を向上させる方法 ソフトウェア開発プロセスにおいて、コードの保守性は非常に重要な要素です。保守可能なコードとは、理解しやすく、変更しやすく、保守しやすいことを意味します。テストはコードの保守性を向上させる非常に効果的な手段です。この記事では、この目的を達成するために PHP コード テスト機能を使用する方法を紹介し、関連するコード例を示します。単体テスト 単体テストは、コード内のテスト可能な最小単位を検証するためにソフトウェア開発で一般的に使用されるテスト方法です。 Pで</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/704371.html" title="ブラウザで PHP コードを記述し、コードが実行されないようにするにはどうすればよいでしょうか?" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/887/227/171005202986189.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="ブラウザで PHP コードを記述し、コードが実行されないようにするにはどうすればよいでしょうか?" /> </a> <a href="https://www.php.cn/ja/faq/704371.html" title="ブラウザで PHP コードを記述し、コードが実行されないようにするにはどうすればよいでしょうか?" class="phphistorical_Version2_mids_title">ブラウザで PHP コードを記述し、コードが実行されないようにするにはどうすればよいでしょうか?</a> <span class="Articlelist_txts_time">Mar 10, 2024 pm 02:27 PM</span> <p class="Articlelist_txts_p">ブラウザで PHP コードを記述し、コードが実行されないようにするにはどうすればよいでしょうか?インターネットの普及に伴い、Web開発に触れる人が増え、PHPの学習にも注目が集まっています。 PHP はサーバー側で実行されるスクリプト言語であり、動的な Web ページを作成するためによく使用されます。ただし、演​​習フェーズでは、ブラウザーで PHP コードを作成して結果を確認できるようにしたいと考えていますが、コードが実行されることは望ましくありません。では、ブラウザで PHP コードを記述し、それが実行されないようにするにはどうすればよいでしょうか?以下、詳細に説明する。初め、</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/592428.html" title="PHP コードは、Baidu Wenxinyiyan API インターフェイスのリクエスト パラメータの暗号化および復号化処理を実装します。" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/887/227/169220045794498.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="PHP コードは、Baidu Wenxinyiyan API インターフェイスのリクエスト パラメータの暗号化および復号化処理を実装します。" /> </a> <a href="https://www.php.cn/ja/faq/592428.html" title="PHP コードは、Baidu Wenxinyiyan API インターフェイスのリクエスト パラメータの暗号化および復号化処理を実装します。" class="phphistorical_Version2_mids_title">PHP コードは、Baidu Wenxinyiyan API インターフェイスのリクエスト パラメータの暗号化および復号化処理を実装します。</a> <span class="Articlelist_txts_time">Aug 16, 2023 pm 11:40 PM</span> <p class="Articlelist_txts_p">PHP コードは、開発者が呼び出すことができるインターフェースの 1 つである、Baidu Wenxin Yiyan API インターフェースのリクエストパラメータの暗号化と復号化処理を実装したものです。データのセキュリティを確保するために、リクエスト パラメータを暗号化し、レスポンスを受信した後にレスポンスを復号化することができます。以下は、Baidu Wenxinyiyan API インターフェイスのリクエスト パラメータの暗号化および復号化処理を実装する PHP コードの例です。</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/603200.html" title="PHP コードが最新のコード仕様に準拠しているかどうかを自動的にチェックするにはどうすればよいですか?" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/887/227/169397482290436.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="PHP コードが最新のコード仕様に準拠しているかどうかを自動的にチェックするにはどうすればよいですか?" /> </a> <a href="https://www.php.cn/ja/faq/603200.html" title="PHP コードが最新のコード仕様に準拠しているかどうかを自動的にチェックするにはどうすればよいですか?" class="phphistorical_Version2_mids_title">PHP コードが最新のコード仕様に準拠しているかどうかを自動的にチェックするにはどうすればよいですか?</a> <span class="Articlelist_txts_time">Sep 06, 2023 pm 12:33 PM</span> <p class="Articlelist_txts_p">ツールを使用して、PHP コードが最新のコーディング標準に準拠しているかどうかを自動的にチェックするにはどうすればよいですか?はじめに: ソフトウェア開発プロセスでは、コードの読みやすさ、保守性、拡張性を確保するために、特定のコード仕様に従う必要があることがよくあります。ただし、コード仕様を手動で確認するのは面倒でエラーが発生しやすい作業です。効率を向上させ、エラーを減らすために、いくつかのツールを使用してコード仕様を自動的にチェックできます。この記事では、いくつかの人気ツールを使用して、PHP コードが最新のコーディング標準に準拠しているかどうかを自動的にチェックする方法を紹介します。 1.PH</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/591358.html" title="PHP コードのデバッグ エラーと予期しない動作" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/465/014/169183019063335.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="PHP コードのデバッグ エラーと予期しない動作" /> </a> <a href="https://www.php.cn/ja/faq/591358.html" title="PHP コードのデバッグ エラーと予期しない動作" class="phphistorical_Version2_mids_title">PHP コードのデバッグ エラーと予期しない動作</a> <span class="Articlelist_txts_time">Aug 12, 2023 pm 04:49 PM</span> <p class="Articlelist_txts_p">タイトル: PHP コードのデバッグ: 解析エラーと予期せぬ動作 はじめに: デバッグは、PHP アプリケーションを開発する際の重要なスキルです。コードがエラーや予期しない動作を報告した場合、問題を迅速に特定して修正する必要があります。この記事では、いくつかの一般的な PHP エラーと予期しない動作を調査し、対応するコード例とデバッグ方法を示します。 1. 文法上の誤り 文法上の誤りは、最も一般的な誤りの 1 つです。 PHP では、構文エラーによりスクリプト全体が正しく実行されなくなる可能性があります。サンプルコードは次のとおりです: &lt;?php</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/590986.html" title="PHPコードのテスト機能とその重要性を分析する" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/000/164/169173794195886.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="PHPコードのテスト機能とその重要性を分析する" /> </a> <a href="https://www.php.cn/ja/faq/590986.html" title="PHPコードのテスト機能とその重要性を分析する" class="phphistorical_Version2_mids_title">PHPコードのテスト機能とその重要性を分析する</a> <span class="Articlelist_txts_time">Aug 11, 2023 pm 03:12 PM</span> <p class="Articlelist_txts_p">PHP コード テスト機能とその重要性の分析 はじめに: ソフトウェア開発プロセスにおいて、コード テストは不可欠なリンクです。コードをテストすることで、潜在的なバグやエラーを効果的に発見して解決でき、コードの品質と安定性を向上させることができます。 PHP開発では機能のテストも重要です。この記事では、PHP コード テストの機能と重要性を詳しく掘り下げ、例を示して説明します。 1. PHP コードテストの機能単体テスト (UnitTesting) 単体テストは最も一般的なテスト方法です。</p> </div> <div class="phphistorical_Version2_mids"> <a href="https://www.php.cn/ja/faq/589342.html" title="PHPコードの静的解析と脆弱性検出技術" class="phphistorical_Version2_mids_img"> <img onerror="this.onerror=''; this.src='/static/imghw/default1.png'" src="/static/imghw/default1.png" class="lazy" data-src="https://img.php.cn/upload/article/000/887/227/169140008150887.jpg?x-oss-process=image/resize,m_fill,h_207,w_330" alt="PHPコードの静的解析と脆弱性検出技術" /> </a> <a href="https://www.php.cn/ja/faq/589342.html" title="PHPコードの静的解析と脆弱性検出技術" class="phphistorical_Version2_mids_title">PHPコードの静的解析と脆弱性検出技術</a> <span class="Articlelist_txts_time">Aug 07, 2023 pm 05:21 PM</span> <p class="Articlelist_txts_p">PHP コードの静的分析と脆弱性検出テクノロジの紹介: インターネットの発展に伴い、PHP は非常に人気のあるサーバーサイド スクリプト言語として、Web サイトの開発や動的 Web ページの生成に広く使用されています。ただし、PHP 構文は柔軟で標準化されていないため、開発プロセス中にセキュリティの脆弱性が簡単に導入されます。この問題を解決するために、PHPコードの静的解析と脆弱性検出技術が登場しました。 1. 静的分析テクノロジー 静的分析テクノロジーとは、ソース コードを分析し、静的ルールを使用して、コードが実行される前に潜在的なセキュリティ問題を特定することを指します。</p> </div> </div> <a href="https://www.php.cn/ja/be/" class="phpgenera_Details_mainL4_botton"> <span>See all articles</span> <img src="/static/imghw/down_right.png" alt="" /> </a> </div> </div> </div> </main> <footer> <div class="footer"> <div class="footertop"> <img src="/static/imghw/logo.png" alt=""> <p>福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!</p> </div> <div class="footermid"> <a href="https://www.php.cn/ja/about/us.html">私たちについて</a> <a href="https://www.php.cn/ja/about/disclaimer.html">免責事項</a> <a href="https://www.php.cn/ja/update/article_0_1.html">Sitemap</a> </div> <div class="footerbottom"> <p> © php.cn All rights reserved </p> </div> </div> </footer> <input type="hidden" id="verifycode" value="/captcha.html"> <script>layui.use(['element', 'carousel'], function () {var element = layui.element;$ = layui.jquery;var carousel = layui.carousel;carousel.render({elem: '#test1', width: '100%', height: '330px', arrow: 'always'});$.getScript('/static/js/jquery.lazyload.min.js', function () {$("img").lazyload({placeholder: "/static/images/load.jpg", effect: "fadeIn", threshold: 200, skip_invisible: false});});});</script> <script src="/static/js/common_new.js"></script> <script type="text/javascript" src="/static/js/jquery.cookie.js?1745035956"></script> <script src="https://vdse.bdstatic.com//search-video.v1.min.js"></script> <link rel='stylesheet' id='_main-css' href='/static/css/viewer.min.css?2' type='text/css' media='all' /> <script type='text/javascript' src='/static/js/viewer.min.js?1'></script> <script type='text/javascript' src='/static/js/jquery-viewer.min.js'></script> <script type="text/javascript" src="/static/js/global.min.js?5.5.53"></script> <script> var _paq = window._paq = window._paq || []; /* tracker methods like "setCustomDimension" should be called before "trackPageView" */ _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function () { var u = "https://tongji.php.cn/"; _paq.push(['setTrackerUrl', u + 'matomo.php']); _paq.push(['setSiteId', '9']); var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0]; g.async = true; g.src = u + 'matomo.js'; s.parentNode.insertBefore(g, s); })(); </script> <script> // top layui.use(function () { var util = layui.util; util.fixbar({ on: { mouseenter: function (type) { layer.tips(type, this, { tips: 4, fixed: true, }); }, mouseleave: function (type) { layer.closeAll("tips"); }, }, }); }); document.addEventListener("DOMContentLoaded", (event) => { // 定义一个函数来处理滚动链接的点击事件 function setupScrollLink(scrollLinkId, targetElementId) { const scrollLink = document.getElementById(scrollLinkId); const targetElement = document.getElementById(targetElementId); if (scrollLink && targetElement) { scrollLink.addEventListener("click", (e) => { e.preventDefault(); // 阻止默认链接行为 targetElement.scrollIntoView({ behavior: "smooth" }); // 平滑滚动到目标元素 }); } else { console.warn( `Either scroll link with ID '${scrollLinkId}' or target element with ID '${targetElementId}' not found.` ); } } // 使用该函数设置多个滚动链接 setupScrollLink("Article_Details_main1L2s_1", "article_main_title1"); setupScrollLink("Article_Details_main1L2s_2", "article_main_title2"); setupScrollLink("Article_Details_main1L2s_3", "article_main_title3"); setupScrollLink("Article_Details_main1L2s_4", "article_main_title4"); setupScrollLink("Article_Details_main1L2s_5", "article_main_title5"); setupScrollLink("Article_Details_main1L2s_6", "article_main_title6"); // 可以继续添加更多的滚动链接设置 }); window.addEventListener("scroll", function () { var fixedElement = document.getElementById("Article_Details_main1Lmain"); var scrollTop = window.scrollY || document.documentElement.scrollTop; // 兼容不同浏览器 var clientHeight = window.innerHeight || document.documentElement.clientHeight; // 视口高度 var scrollHeight = document.documentElement.scrollHeight; // 页面总高度 // 计算距离底部的距离 var distanceToBottom = scrollHeight - scrollTop - clientHeight; // 当距离底部小于或等于300px时,取消固定定位 if (distanceToBottom <= 980) { fixedElement.classList.remove("Article_Details_main1Lmain"); fixedElement.classList.add("Article_Details_main1Lmain_relative"); } else { // 否则,保持固定定位 fixedElement.classList.remove("Article_Details_main1Lmain_relative"); fixedElement.classList.add("Article_Details_main1Lmain"); } }); </script> </body> </html>