Merry Merry Christmas MySQL-based forum (4)

Source: Internet
Author: User
Tags setcookie
# # index.php


<title>Forum</title>






&lt;noframes&gt;&amp;lt;body bgcolor= "#FFFFFF" &amp;gt; &amp;lt;br&amp;gt;&amp;lt;/body&amp;gt;&lt;/noframes&gt;

# # Left.php
$FP =fopen ("File/counter.txt", "R");
$counter =fgets ($FP, 8);
Fclose ($FP);
$counter = $counter +1;
$FP =fopen ("File/counter.txt", "w");
Fputs ($fp, $counter);
Fclose ($FP);
Require ("config.inc.php");
$sql = "SELECT * from Boardinfo";
$sql _result=mysql_query ($sql);
$sql _row=mysql_fetch_array ($sql _result);
?>


<title>Layout list</title>






























do {echo " "; Echo "; Echo "; } while ($sql _row=mysql_fetch_array ($sql _result));?>
Registered users
---------
$sql _row[chinesename]
---------



--------




# # List.php
Require ("func.php");
if (empty ($board)) {
$board = "Computer";
}
$sql = "SELECT * from Boardinfo where name= ' $board '";
$sql _result=mysql_query ($sql);
$sql _row=mysql_fetch_array ($sql _result);
$chinesename = $sql _row[chinesename];
Setcookie ("Jl_forum[chinesename]", $chinesename);
$sql = "SELECT name from user where slaveboard= ' $board '";
$sql _result=mysql_query ($sql);
?>


<title>List</title>















layout:!--? php echo $chinesename;
?
Moderator:!--? php while ($sql _row=mysql_fetch_array ($sql _result))
{
echo "$sql _row[name]". " ";
}
# Select the message record;
$sql = "SELECT * from $board where slaveid=0";
$temp =mysql_query ($sql);
$sum =mysql_num_rows ($temp);
$totalpage =ceil ($sum/$pagesize);
if ($sum ==0) {
$totalpage = 1;
}
# Paging
if ($page <1 or Empty ($page)) {
$page = 1;
}
ElseIf ($page > $totalpage) {
$page = $totalpage;
}
$offset = ($page-1) * $pagesize;
$sql = "SELECT * from $board the where slaveid=0 order by id desc limit $offset, $pagesize";
$sql _result=mysql_query ($sql);
?>
Total posts:!--? php echo $sum;?-->
"> Refresh browse


























while ($sql _row=mysql_fetch_array ($sql _result)) {echo " "; Echo "; Echo "; Echo "; Echo "; Echo "; } ? >
Response Topic Time Popularity
";
if ($sql _row[renum]!=0)
{
echo "[+ $sql _row[renum]]";
}
Else
{
echo "[0]";
}
Echo
$sql _row[title]$sql _row[writetime]$sql _row[hits]







# # Login.php
Require "func.php";
if ($name = = $admin _name and $password = = $admin _password) {
Setcookie ("Jl_admin[name]", $name);
Setcookie ("Jl_admin[password]", $name);
Redirect2 ("admin.php");
}
else {
Show_error (1);
}
?>
# # Manage.php
Require "func.php";
if (Check_admin_password ()) {
Switch ($job) {
Case "Setgood":
Set_good ($jl _forum[board], $id);
Break
Case "Setnogood":
Set_no_good ($jl _forum[board], $id);
Break
Case "Delete":
Del_doc ($jl _forum[board], $id);
Break
}
echo "

Operation Successful!


";
?>
<title>O,k</title>



}
else {
Show_error (1);
}
?>
# # Manage_list.php
Require ("func.php");
if (Check_admin_password ()) {
$board = $jl _forum[board];
$sql = "SELECT * from Boardinfo where name= ' $board '";
$sql _result=mysql_query ($sql);
$sql _row=mysql_fetch_array ($sql _result);
$chinesename = $sql _row[chinesename];
Setcookie ("Jl_forum[chinesename]", $chinesename);
$sql = "SELECT name from user where slaveboard= ' $board '";
$sql _result=mysql_query ($sql);
?>


<title>List</title>















Layout: echo $chinesename;
?> (Management)
Moderator: While ($sql _row=mysql_fetch_array ($sql _result))
{
echo "$sql _row[name]". ";
}
# Select a message record;
$sql = "SELECT * from $board where slaveid=0";
$temp =mysql_query ($sql);
$sum =mysql_num_rows ($temp);
$totalpage =ceil ($sum/$pagesize);
if ($sum ==0) {
$totalpage = 1;
}
# pagination
if ($page <1 or Empty ($page)) {
$page = 1;
}
ElseIf ($page > $totalpage) {
$page = $totalpage;
}
$offset = ($page-1) * $pagesize;
$sql = "SELECT * from $board the where slaveid=0 order by id desc limit $offset, $pagesize";
$sql _result=mysql_query ($sql);
?>
Total Posts: "> Refresh Browse


























while ($sql _row=mysql_fetch_array ($sql _result)) {echo " "; Echo "; Echo "; Echo "; Echo "; Echo "; } ? >
Response Topic Time Popularity
";
if ($sql _row[renum]!=0)
{
echo "[+ $sql _row[renum]]";
}
Else
{
echo "[0]";
}
Echo
$sql _row[title]$sql _row[writetime]$sql _row[hits]







}
else {
Show_error (4);
}
?>

The above describes the merry Merry Christmas based on the MySQL forum (4), including The Merry Merry Christmas content, I hope to be interested in PHP tutorial friends helpful.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.