我們?cè)趯?shí)際做的過(guò)程中很是簡(jiǎn)單的,希望大家好好研究一下,給補(bǔ)充多點(diǎn)功能。本程序須在php and mysql的環(huán)境下運(yùn)行。有三個(gè)文件:comments.php, 是用來(lái)顯示[評(píng)論的, commentadd.php, 用來(lái)處理評(píng)論內(nèi)容的, and commentform.html 通過(guò)from來(lái)提交評(píng)論。
1.首先建立一個(gè)數(shù)據(jù)庫(kù),如果已經(jīng)建立則建立一個(gè)符合條件的表: create table `comtbl` ( `postid` int not null auto_increment , `posttitle` text not null , `postername` text not null , `posteremail` text not null , `posttime` timestamp not null , `posttxt` text not null , primary key ( `postid` ) );