I really appreciate the responses guys. I am sorry I wasn't more specific. I should have really said up front that it is not an sql database.
I'll post the code which I should have done in the beginning :(
The articles just go into an article folder.
Here's the full code:
Quote:
<?php
$folder = "/server path/domainnamehere.com/articles";
$dirhandle = opendir("$folder");
while($file_name = readdir($dirhandle)) {
if ($file_name != "."
&& $file_name != ".."
&& $file_name != "list.php"
&& $file_name != "index.html"
) {
// DO THIS FOR EACH FILE
// get contents of a file into a string
$filename = "$folder/$file_name";
$handle = fopen($filename, "rb");
$contents = fread($handle, 1000);
fclose($handle);
$matches = "";
// EXTRACT Title
if(preg_match("'<title>(.+)</title>'i", $contents, $matches)){
$title = $matches[1];
print("<div class=\"medium-header\"><A HREF=\"$file_name\">$title</A></div>");
$matches = "";
}
// EXTRACT Description
if(preg_match("'<META NAME=\"Description\" CONTENT=\"(.+)\">'i", $contents, $matches)){
$description = $matches[1];
print("$description<BR><BR><HR>");
$matches = "";
}
print("");
}
}
?>
|
Thx again for helping.