include() multiple files? (blog script)
Posted: Wed Nov 19, 2003 2:27 am
FYI i'm like an absolute n00b in programming period, did SOME ASP a while ago, did SOME VB (i know they're pretty much the same) and some Javascript all usually very basic stuff. So bear with me.
I'm trying to make a blog script, that will include each file (03.11.19.php(date YY.MM.DD)) in order... so that I don't have to put them all in a file, i then later i want to have it categorize the blogs per year. which is why i did the filenames the way they are... I'm VERY open to suggestions, I can get this to work with one file, and I know why it doesn't work with two, because it tries to add all the filenames into one var. $file_list But i just can't think of a way to seperate it so that i can load all those files. Thank you all for your time.
Note: I got this out of PHP fast and easy web development, and so far the book has helped and i havn't finished reading it, but i really want to jump the gun and make this script... So any help is welcome.
I'm trying to make a blog script, that will include each file (03.11.19.php(date YY.MM.DD)) in order... so that I don't have to put them all in a file, i then later i want to have it categorize the blogs per year. which is why i did the filenames the way they are... I'm VERY open to suggestions, I can get this to work with one file, and I know why it doesn't work with two, because it tries to add all the filenames into one var. $file_list But i just can't think of a way to seperate it so that i can load all those files. Thank you all for your time.
Code: Select all
<?PHP
$dir_name = "blogs/";
$dir = opendir($dir_name);
$file_list = "";
$files = "";
while ($file_name = readdir($dir)) {
if (($file_name != ".") && ($file_name != "..")) {
$file_list .= "$file_name";
}
}
$files .= "$dir_name";
$files .= "$file_list";
closedir($dir);
?>