現在のページのコンテンツをロードし、PHP またはPHP Simple Html DOM パーサー。
これまでの私のコード:
<?php
$pg = 'c.html';
include_once '%resource(simple_html_dom.php)%';
/* $cpath = $_SERVER['REQUEST_URI']; Old version */ // Path to current pg from root
$cpath = "http://www.".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
echo var_dump($cpath).": Current Root Path"."<br />"; // "http://www.partiproductions.com/copyr/index.php" - Correct
$cfile = basename($cpath);
echo 'Current File: ' . $cfile . "<br />"; // "index.php" - Current pg, Correct
$html = file_get_html($cpath); // Getting Warning: URL file-access is disabled in the server configuration & failed to open stream: no suitable wrapper could be found in.. & Fatal error: Call to a member function find() on a non-object in...
foreach($html->find(sprintf('#navbar a[href=%s]', $pg)) as $path) {
echo 'Path: ' . $path."<br />";
}
?>