post.php a PHP program that reads files and displays the contents of the log.
page.html Displays the HTML document for the log article.
STYLE.CSS Tutorial page shows the effect of the CSS code.
add.php Add a blog article PHP program.
config/auth.php username and password configuration file.
Index.php Blog Homepage program.
edit.php Edit the blog article program.
delete.php Delete the blog article program.
archives.php to file a program that displays blog posts.
logout.php exit the login program.
*/
post.php a PHP program that reads files and displays the contents of the log.
The code is as follows |
Copy Code |
<?php if (!isset ($_get[' entry ')) { Echo ' request parameter error '; Exit } $post _data = Array (); $path = substr ($_get[' entry '],0,6); Log storage Directory $entry = substr ($_get[' entry '],7,9); Log file name $file _name = ' contents/'. $path. ' /'. $entry. '. TXT '; if (file_exists ($file _name)) { $fp = @fopen ($file _name, ' R '); if ($FP) { Flock ($FP, lock_sh); $result = Fread ($fp, FileSize ($file _name) *100); } Flock ($FP, lock_un); Fclose ($FP); } $content _array = explode (' | ', $result); $post _data[' subject '] = $content _array[0]; $post _data[' date '] = Date (' y-m-d h:i:s ', $content _array[1]); $post _data[' content '] = $content _array[2]; Print_r ($post _data); ?> <!doctype HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/ Xhtml1-transitional.dtd "> <title> a simple blog</title> based on text <link rel= "stylesheet" type= "Text/css" href= "Style.css"/> <body> <div id= "Container" > <div id= "Header" > </div> <div id= "title" > ----I have dream .... </div> <div id= "Left" > <div id= "Blog_entry" > <div id= "Blog_title" ><? echo $post _data[' subject '];? ></div> <div id= "Blog_body" > <div id= "Blog_date" ><? echo $post _data[' Date '];? ></div> ? echo $post _data[' content '];? > </div><!--blog_body--> </div><!--blog_entry--> </div>
<div id= "Right" > <div id= "sidebar" > <div id= "Menu_title" > About me </div> <div id= "Menu_body" >www.111cn.net</div> </div> </div>
<div id= "Footer" > Copyright 2007 </div> </div> <body>
|
page.html Displays the HTML document for the log article.
The code is as follows |
Copy Code |
<!doctype HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/ Xhtml1-transitional.dtd "> <title>blog</title> <link rel= "stylesheet" type= "Text/css" href= "Style.css"/> <body> <div id= "Container" > <div id= "Header" > </div> <div id= "title" > ----I have a dream .... </div> <div id= "Left" > <div id= "Blog_entry" > <div id= "Blog_title" > Log article title </div> <div id= "Blog_body" > <div id= "Blog_date" >2007-12-01</div> Log article content </div> </div> </div>
<div id= "Right" > <div id= "sidebar" > <div id= "Menu_title" > About me </div> <div id= "Menu_body" >www.111cn.net</div> </div> </div>
<div id= "Footer" > Copyright 2007 </div> </div> <body>
|
Home 1 2 3 4 5 6 7 8
last