Following on from the text upload form this script displays the title of the text file as a hyperlink.
It also strips the file extention away to keep it more inline with a internet 'feel'.
The link will take you to a page with the contents of the text file.
<?php
$url = './upload_text/';
$handle = opendir ($url);
while (false !== ($file = readdir($handle))){$remove = explode(".",$file);$remove = $remove[sizeof($remove)-2];
if($file != "." && $file != ".." && $file != basename(__FILE__)){echo '<a href="./upload_text/'.$file.'">'.$remove.'</a><br />';}
}
?>
//Start PHP protocol
//Define directory to display
//Define URL
//Loop to display all text
//Remove file extensions
//Plus two back
//Anoher way to remove file extensions
//$remove = $file;
//$remove= substr($remove, 0 , -4);
//Remove directory periods
//Print results
//End loop
End PHP protocol