Hi,
i have a small function here, i’m trying to get all file names from a particular folder and display them in a window. Then i href them, made them as links, because all file names are page names, but when i click one of them i get something like this The requested URL /~artbuto/ateitis.ktm.lt was not found on this server.. So the problem is how can i separate the file name from my domain name, that when i click the link i would be directed to ateitis.ktm.lt ?
[php]display_URL();
function display_URL(){
$dir = “/home/artbuto/public_html/sites-available/”;
if ($handle = opendir($dir)) {
echo “Puslapiai:\n”;
/* This is the correct way to loop over the directory. */
while (false !== ($entry = readdir($handle))) {
// Grab first 2 lines of Markdown file
$content = file($dir . '/' . $entry);
$title = $content[0];
$description = $content[1];
if(strpos($title, '# neskelbti') !== false){
}
else{
echo "<a href=\"$entry\">$entry</a>\n";
echo "$title\n";
echo "<html><br></html>";
}
}
closedir($handle);
}
}[/php]