Home Backend Development PHP Tutorial Source code My forum source code 1

Source code My forum source code 1

Jul 29, 2016 am 08:33 AM
source code

In fact, it only took me three days to write these codes. There was no detailed thinking or planning beforehand (it can be said that there was no plan at all). That day I thought of trying to make a forum, so I started to do it, and I just got in touch with it. I have been using PHP for nearly a month, and I have never really written anything like a program before. During the two and a half days of writing this code, I encountered difficulties several times and wanted to give up, but I still wrote it. And I didn't expect it to work, so there may be many hidden dangers that I can't explain, even though it is said to be usable.
In two days, I will go to work, and I won’t have time to carefully check these codes from beginning to end. This is one of the reasons why I put it up. Another reason is because I want everyone to look at it together. Look at these characters. I am just a novice. There may be many shortcuts that I have not taken, and there may be many things that are wrong. In the past two days, I have changed the code of some pages, but other related codes have not been removed, so some places are a bit heavy. cover. But it can run normally, that's for sure (at least it looks normal on the surface. I have no problem using it under WIN98/APACHE/PHP/MYSQL, and it has no problem when testing online. I don't know about other environments. I just hope it will work with me. What can newbies like me, or novices who are better than me, get from it, and if veterans and seniors can write or leave messages to point out the shortcomings or shortcomings, I will be more happy, because in that case, I will also be happy. I can learn a lot from it. My email address is: hllinyu@netease.com, OICQ: 2289230, and the homepage address is: http://lfox.oso.com.cn
Okay, I’ve said too much nonsense. I hope that everyone can devote themselves to modifying the source code of this forum, so that it can become a free forum developed by the Chinese themselves, and that the forum code can be used by many friends like me who are very interested in PHP but feel they have no idea where to start. Reference materials are enough. Let’s take a look at my forum!
First of all, I will introduce the two tables to be used: foxbbs to store post information and useinfo to store user information. Because the data space was not very large, I chose MYSQL. +TXT method, all topics except the content are stored in MYSQL, and the topic content and reply content with relatively large data volume are stored separately in TXT format files with extensions of .FOX and .BBS. Just add a field to store the file name in the table. In order to avoid duplication of file names, use the current system time as the file name. For example, if a post was posted at 11:20:30 on January 2, 2001, the file name would be 20010102112030.txt I think this can meet most of the requirements, because there may not be many forums that are so popular that two or more new posts appear every second! Haha...
The specific situation of this forum. You can see http://lfox.oso.com.cn/foxbbs/foxbbs.php. In addition, the source code package download is provided on the main page http://lfox.oso.com.cn/index.php. Don’t come here after reading the source code. Make trouble.
useinfo user information table
0 usename varchar(8) not null Username
1 usepass varchar(8) Password
2 useni varchar(30) not null Nickname
3 useoicq varchar(12) not null
4 usesex int( 1) Not null User gender
5 useage int(2) Not null User age
6 varchar(4) not null Occupation
7 useaddr varchar(20) not null Address
8 usemail varchar(40) not null email
9 useweb varchar(50) not null Home page
10 useqm varchar(240) not null Signature
11 useattr int(1) not null Attribute 1 user 2 moderator 3 administrator 4 webmaster
12 useinf int(1) not null Is the information public? 1 no 2 yes
13 useid int(5) not auto_increment primary key User ID number
14 usebq int(1) expression
15 regdate datetime; registration Time
16 enddate varchar(22) not null Last arrival time
17 ftnum int(4) not null Number of posts
18 usety char(1) not null
foxbbs forum topic table
0 id int(5) not auto_increment primary key
1 usename varchar(20) NOT Posting user name
2 ftbq int (1) not expression
3 title varchar(40) not theme
4 ftdate varchar(22) not posting time
5 mesname varchar(15) not content file name 20010102055635 I left one extra digit to prevent accidents, actually fourteen bit is enough.
6 djnum int(4) not Number of clicks
7 hfnum int(3) not Number of replies
8 hfdate varchar(24) not Last reply time
9 hfname varchar(20) not Reply file name
10 hfusename varchar(20) not Last reply person name
11 ip varchar(15)
12 lockes int 1
linkfox.inc.php is used to connect to the database
$dbhostname = "lfox";
$dbusername = "root";
$dbpassword = "root ";
$dbName = "flyfox";
MYSQL_CONNECT($dbhostname, $dbusername, $dbpassword) OR DIE("Unable to connect to database");
@mysql_select_db( "$dbName") or die( "Unable to select database");
?>

The above introduces the source code. My forum source code 1 includes source code content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Tutorial on updating curl version under Linux! Tutorial on updating curl version under Linux! Mar 07, 2024 am 08:30 AM

To update the curl version under Linux, you can follow the steps below: Check the current curl version: First, you need to determine the curl version installed in the current system. Open a terminal and execute the following command: curl --version This command will display the current curl version information. Confirm available curl version: Before updating curl, you need to confirm the latest version available. You can visit curl's official website (curl.haxx.se) or related software sources to find the latest version of curl. Download the curl source code: Using curl or a browser, download the source code file for the curl version of your choice (usually .tar.gz or .tar.bz2

Linux kernel source code storage path analysis Linux kernel source code storage path analysis Mar 14, 2024 am 11:45 AM

The Linux kernel is an open source operating system kernel whose source code is stored in a dedicated code repository. In this article, we will analyze the storage path of the Linux kernel source code in detail, and use specific code examples to help readers better understand. 1. Linux kernel source code storage path The Linux kernel source code is stored in a Git repository called linux, which is hosted at [https://github.com/torvalds/linux](http

How to view java source code How to view java source code Dec 27, 2023 pm 04:41 PM

View steps: 1. Find the installation directory or view online; 2. Unzip the source code; 3. Use a text editor or integrated development environment; 4. Navigate and view the source code. Detailed introduction: 1. Find the installation directory or view online: If JDK is installed, you can find the Java source code in the JDK installation directory. In the JDK installation directory, there is usually a src.zip or similar compressed file, which contains the source code of the Java core class library; it is also possible to view the Java source code online, etc.

How to view Tomcat source code How to view Tomcat source code Jan 25, 2024 pm 01:56 PM

Steps to view the Tomcat source code: 1. Download the Tomcat source code; 2. Import the Tomcat source code in IDEA; 3. View the source code; 4. Understand the working principle of Tomcat; 5. Participate in the community and contribute; 6. Precautions; 7. Continuously learn and update; 8. Use tools and plug-ins. Detailed introduction: 1. To download the Tomcat source code, you first need to obtain the source code of Tomcat. You can download the source code package from the official website of Apache Tomcat, etc.

What is the suffix of java source code? What is the suffix of java source code? Dec 27, 2023 pm 04:31 PM

In Java, the suffix for source code files is usually .java. When writing a Java program, a source code file with a .java suffix is ​​created, which contains the Java source code. For example, a simple Java source code file could be named MyClass.java, where MyClass is the name of the class and .java is the suffix of the file.

An in-depth exploration of the Linux kernel source code distribution An in-depth exploration of the Linux kernel source code distribution Mar 15, 2024 am 10:21 AM

This is a 1500-word article that explores the Linux kernel source code distribution in depth. Due to limited space, we will focus on the organizational structure of the Linux kernel source code and provide some specific code examples to help readers better understand. The Linux kernel is an open source operating system kernel whose source code is hosted on GitHub. The entire Linux kernel source code distribution is very large, containing hundreds of thousands of lines of code, involving multiple different subsystems and modules. To gain a deeper understanding of the Linux kernel source code

How can you understand the design principles and goals behind the latest PHP code specification by reading its source code? How can you understand the design principles and goals behind the latest PHP code specification by reading its source code? Sep 05, 2023 pm 02:46 PM

How can you understand the design principles and goals behind the latest PHP code specification by reading its source code? Introduction: When writing high-quality PHP code, it is very important to follow certain coding standards. Through code specifications, the readability, maintainability and scalability of the code can be improved. For the PHP language, there is a widely adopted code specification, namely PSR (PHPStandardsRecommendations). This article will introduce how to read the source code of the latest PHP code specification

Detailed explanation of Linux kernel source code storage location Detailed explanation of Linux kernel source code storage location Mar 14, 2024 pm 06:12 PM

Detailed explanation of the storage location of Linux kernel source code. Linux kernel source code is the core part of the Linux operating system. It contains the implementation code for various functions of the operating system. To understand where the Linux kernel source code is stored, we first need to understand the organizational structure of the Linux kernel. Linux kernel source code is usually stored in the /usr/src/linux or /usr/src/linux- directory. In this directory, there are many

See all articles