This forum used a total of less than 200 lines of code, execution speed quite fast. Running examples in: Http://www.hnpts.ha.cn/forum
MySQL Database: yxforum
+-------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------+--------------+------+-----+---------+----------------+
| ID | Int (11) | | PRI | 0 | auto_increment |
| DT | datetime | YES | | NULL | |
| TP | varchar (255) | YES | | NULL | |
| CT | Text | YES | | NULL | |
| FL | Int (11) | YES | | NULL | |
| IP | varchar (20) | YES | | NULL | |
| Un | varchar (50) | YES | | NULL | |
| EM | varchar (60) | YES | | NULL | |
| num | Int (11) | YES | | NULL | |
+-------+--------------+------+-----+---------+----------------+
index.php:
mysql_select_db ("xxxx", $m);
?>
$HF _fl= $FL;
$q = "SELECT * from Yxforum where id=". $FL;
$MR =mysql_query ($q, $m);
$ra =mysql_fetch_row ($MR);
?>
?>
$lastid = $ra [4];
Print ("
");
Print ("
follow the topic:");
}
$q = "SELECT * from Yxforum where fl=". $fl. "ORDER BY dt DESC";
if ($p = = "") $p = 0;
$MR =mysql_query ($q, $m);
$f =mysql_num_fields ($MR);
$ra =mysql_fetch_row ($MR);
$i = 0; $p 1= $p *15; /* Skip the line corresponding to the specified number of pages */
while ($i < $p 1)
{$i + +;
$ra =mysql_fetch_row ($MR);
if (! $ra) break;}
?>
Latest Response Time
|
The person who published
|
Theme
|
Number of responses
|
$x [0]= "FFFFCC"; $x [1]= "deefff"; $i = 1; while ($RA)/* Displays the current theme */{$ys _c= $i% 2; Print ("
". $ra [1]); Print (" |
". $ra [6]." "); Print (" |
"); printf ("%s", $ra [0], $ra [2]); Print (" |
". $ra [8]); Print (" |
"); $ra =mysql_fetch_row ($MR); $i + +; if ($i >15) break; }?>
Self-Use Forum Program version 0.25 design tool: Php+mysql
Gu Qitzing Sword Making
Carefree Flying Fox Multimedia Workshop 2000
addnew.php:
mysql_select_db ("xxxxx", $m);
$ZW =ereg_replace ("<", "<", $ZW);
$ZW =ereg_replace (">", ">", $ZW);
$ZW =ereg_replace ("n", "
", $ZW);
$ZW =ereg_replace ("", "", $ZW);
$tt =ereg_replace ("<", "<", $TT);
$tt =ereg_replace (">", ">", $tt);
if ($nm = = "") $nm = "Unknown treasure";
if ($em = = "") {$nm. = "<--is a rookie without mail"; $em = "No";}
$err =strlen ($TT) *strlen ($ZW);
if ($err ==0)
$msg = "Don't be lazy!" Fill out the form and submit it no later. ";
else {$q = "insert into Yxforum (dt,tp,ct,fl,ip,un,em,num) values"
." (Now (), "". $tt. "," ". $zw.", ". $fl.", "". $REMOTE _addr. "", "". $nm. "", "". $em. "", "". ".", "". "," "."
mysql_query ($q, $m);
$q = "Select Num,fl from Yxforum where id=". $FL;
$FL _a= $FL;
do {$mr =mysql_query ($q, $m);
$ra =mysql_fetch_row ($MR);
$num = $ra [0]+1;
$q = "Update yxforum set Dt=now (), num=". $num. "Where id=". $FL;
$FL = $ra [1];
mysql_query ($q, $m);
$q = "Select Num,fl from Yxforum where id=". $FL;
} while ($fl >0);
$msg = "Your comments have been successfully submitted!" ";
}
?>
The system will automatically return after 3 seconds. If you cannot return or you are in a hurry, please press &p= > Here
The above describes the 51testing Software Testing Forum A concise multi-level forum, including the 51testing Software Testing forum content, I hope to be interested in PHP tutorial friends helpful.