BBS (php & amp; mysql) full version (1 ). This page is say. php? Includesignupmysql. inc; if ($ id1) {$ sqlselect * from $ tablewhere; returns question $ resultmysql_query ($ SQL) ordie (mysql_error (); $ rowmysql // This page is say. php
Include "signup/mysql. inc ";
If ($ id1 ){
$ SQL = "select * from $ table where id = '$ id1'"; // A reply question is displayed.
$ Result = mysql_query ($ SQL) or die (mysql_error ());
$ Row = mysql_fetch_array ($ result );
$ Title = "RE:". $ row ["title"];
}
$ Ip = $ REMOTE_ADDR;
$ SQL = "select * from user_stus where ip = '$ IP'"; // query the current user name
$ Result = mysql_query ($ SQL) or die (mysql_error ());
$ Row = mysql_fetch_array ($ result );
If (! $ Row) // Determine whether the user logs in
{
Echo"
";
Echo"
";
Echo"
";
Echo"
Hey !! Please log in first
";
Echo"
Return
";
Exit ();
}
Else $ userid = $ row ["userid"];
If ($ OK)
{
If ($ title = "" | $ content = "")
{
Echo"
Please add the complete information and submit it ";
}
Else {
$ Id = time (); // submit an article
$ Date1 = date ("Y/m/d ");
$ Title = htmlspecialchars ($ title );
$ Content = htmlspecialchars ($ content );
$ SQL = "select * from". $ table;
$ Result = mysql_query ($ SQL) or die (mysql_error ());
$ Row1 = mysql_num_rows ($ result );
$ Row1 ++;
If ($ id1 ){
$ SQL = "insert into bbs_re (id, userid, date1, title, content) values ('$ ID',' $ userid', '$ date1', '$ title ', '$ content ')";
Mysql_query ($ SQL) or die (mysql_error ());
$ SQL = "select * from". $ table. "where id = '$ id1 '";
$ Result = mysql_query ($ SQL) or die (mysql_error ());
$ Lin = mysql_fetch_array ($ result );
For ($ I = 1; $ I <6; $ I ++)
{
$ Re = "r". $ I;
If (! $ Lin ["$ re"])
Break;
}
$ SQL = "update". $ table. "set". $ re. "= '$ ID' where id =' $ id1 '";
}
Else
$ SQL = "insert ". $ table. "(id, userid, date1, title, content, row) values ('$ ID',' $ userid', '$ date1', '$ title ', '$ content',' $ row1 ')";
$ Result = mysql_query ($ SQL) or die (mysql_error ());
If ($ result)
{
Header ("Location: php3.php? P = 1 & table = $ table ");
Exit;
}
}
}
?>
Xiaoyang