=========================================================== PHPファイル内のどのルートを通ったかを調べる方法 =========================================================== まず "outr(xhr)"内の「console.clear()」をDisableする。 ----------------------------------------------------------- function outr(xhr){ if(xhr.status==200){ /*@@ if the response is success(200), then emit the contents */ document.write(xhr.responseText); }else{ /*@@ If the response is unsuccessful, then an error will be displayed in the console. Clear it */ //console.clear(); <========================================== Disable this line } }; ----------------------------------------------------------- 次に調べたいルートに以下のコードを挿入する。 ----------------------------------------------------------- header("HTTP/1.0 405 Not Found"); exit; ----------------------------------------------------------- 例: ----------------------------------------------------------- // if ( substr($fn,0,strlen($tfn)) != $tfn ) { //@@ 「元HTMLのファイル名」が存在することを確認する if ( file_exists($fn) ) { //@@ 「元HTML」をブラウザへ出力する readfile($fn); exit; } header("HTTP/1.0 405 Not Found"); exit; } } ----------------------------------------------------------- 通常、"Not Found"の番号は404であるが、これを405にしておく。 もしこの地点を通った場合、Inspectorに、以下のように、405が表示される。 ----------------------------------------------------------- _kdkht-pp-pp-pp-pp_.php?p=fp-fp-fp-fp:36 POST http://wapp.solar.lan/phpkobo/my-projects/ajax-nandokuka/NHKDK-219/public_html/kdk-builder/source/jp/script/_kdkht-pp-pp-pp-pp_.php 405 (Not Found) ----------------------------------------------------------- また以下のようにすれば、phpの変数(例:$fn)の値をブラウザのコンソールに表示できる。 ----------------------------------------------------------- header("HTTP/1.0 405 Not Found ".$fn); exit; -----------------------------------------------------------