Here, give this a whirl: (TESTED)
Tested on my server using absolute
path.
<?php
// path to .php files must be absolute path
// example: /server/user/f/fred/forms/*.php
// May have to modify your path if it's not absolute
// You may have to use this, if doesn't work
// $articles = glob("$_SERVER[DOCUMENT_ROOT]/assets/news/forms/*.php");
$articles = glob("/assets/news/forms/*.php");
if(count($articles)) {
natcasesort($articles);
// rsort($articles); // use rsort for descending order
foreach($articles as $article) {
$article = basename($article);
// You may have to use this, if doesn't work
// include("$_SERVER[DOCUMENT_ROOT]/assets/news/forms/$article");
include("$_SERVER[DOCUMENT_ROOT]/assets/news/forms/$article");
}
}
else {
echo "Sorry, no articles.";
}
?>