One, the article List question:
Create a field in the database, record the file name, each generation of a file, the automatically generated file name is stored in the database, for the recommended article, just point to the folder that holds the static file in the designated folders that page. Use PHP to manipulate the list of articles, save as a string, and replace this string when generating a page. For example, a table that places a list of articles in a page adds tag {articletable} and in a PHP processing file:
Code:
$title = "Tuo mai international test Template";
$file = "Twomax Inter test Templet,
Author:_max ">matrix@two_max";
$fp = fopen ("temp.html", "R");
$content = fread ($fp, FileSize ("temp.html"));
$content. = Str_replace ("{file}", $file, $content);
$content. = Str_replace ("{title}", $title, $content);
// build list start
$list = ';
$sql = ' Select Id,title,filename from aspires ';
$query = mysql_query ($sql);
while ($result = Mysql_fetch_array ($query)) {
$list. = '. $result [' title ']. '
';
}
$content. = Str_replace ("{articletable}", $list, $content);
//Generate list End
//echo $content;
$filename = "test/test.html";
$handle = fopen ($filename, "w"); Open the file pointer, create the file
/*
to check whether the file was created and writable
*/
if (!is_writable ($filename)) {
die ("File:". $filename. " Not writable, please check itsProperty and try again! ");
}
if (!fwrite ($handle, $content)) { //write information to file
die (build file. $filename. " Failed! ");
}
fclose ($handle);//close pointer
die (create file. $filename. " Success! ");
?>