I have a certain code, and I've used it succesfully before, but now it doesn't work (I've used it with another tags):
No what I ask you to do, is to see this file in http://www.tat.fi/php/sivukartta.php, and see what it does.
//read the names of all shtml-files in the directory
$the_path="../php";
$handle = dir($the_path);
print "\n<b>File List</b><br>";
while ($file = $handle->read()) {
if ((ereg(".shtml$", $file)) && ($file != ".") && ($file != "..")) {
print "\n" . $file . "<br>";
//print "<hr>";
//read the text between <title>-tags from every shtml-page
$fd = fopen ($file, "r");
while (!feof ($fd)) {
$html .= fread($fd, 4096);
if (preg_match('#<title>(.*)<\/title>#is', $html, $match));
break;
}
if(isset($match[1])) { // Found a match, but...
echo "<a href=\"$file\">$match</a><br>";
}
else { // Problem - we read the entire
// file but didn't find what we're looking for.
echo "The page not found.";
}
}
}
Then I have another version (http://www.tat.fi/php/sivukartta2.php), where I have changed only this:
echo "<a href=\"$file\">$match[1]</a><br>";
and now it gives me quite a mess (see the page title?!). I really don't know what's going on...😕
Thanks very much.