我有一個PHP腳本,我想它,以便它只會顯示,如果你在你的瀏覽器中查看該頁面的某些文字,它不是由另一個腳本包含..只有顯示不包括?
例如
//foo.php
<?php
if(!included){
echo "You can only see this if this is the page you're viewing";
}
?>
//bar.php
<?php
include 'foo.php';
?>
現在,當你查看「bar.php」時,你不應該看到文本..但是,如果你打開foo.php,你會..我怎麼做這個..?如果可能的話..
這完美的作品:)謝謝:) –
@ thefiscster510如果它的工作完美,考慮接受答案。 – honyovk