Skip to main content

Simple Forum/Discussion System using PHP/MySQL with Source Code

Language

Project: Simple Forum/Discussion System using PHP/MySQL with Source Code

About

The Simple Forum/Discussion System is a simple PHP/MySQL project that can help a certain school or company to discuss a certain topic that may relate to others within the school or company circle nowadays due to the pandemic. We all know that nowadays there's an inconvenience working and studying because some of the processes or work are forced to be done online,home-based, or whatever word to describe long-distance transactions or processes, which the forum or discussion system may help by organizing a certain topic to be discussed. Yes, we have FB Messenger, Viber, Skype, and other online application that help us to communicate online, conversations can be random and others can't catch up easily while this system main purpose is not only to communicate with others but also to provide a discussion page where may also help another employee for a company or student and teacher for schools for example when a user 1 posted a topic or discussion on the system obviously some other users may comment to a certain topic, since the topic may be a question because the user 1 is having a hard time to solve or any instances may occur which he/she needs help for a co-worker/s that might be experienced already and solve the instance, this worker can simply drop a comment on this topic that may help his/her coworker/fellow student. You might wonder that the scenario can also be done in some application such as chat applications, well, the main purpose of this system is that the system stores all posted topic with the comments and replies, which means that in the future, some users may encounter the scenario, problems or questions that he/she needed an answer, the user can find or retrieve any related discussion that was already done in the past which means he/she might find the answers to his/her question without posting a new discussion and wait to other users to drop their ideas to your posted questions. The system was inspired by the StackOverflow website which is commonly used by developers, programmers, or any IT related works.
 The Simple Forum/Discussion System source code has only a small scope project but features the main purpose for this article or system idea.

Features

  • Login Page
    • The page where the system users submit their system credentials to access the data of the system and join a discussion.
  • Home Page
    • The page where the system users will be redirected by default after logging in. This page displays the summary of the system user, topics, and tags/categories
  • Tags/Categories Page
    • The page where the system users will manage the list of the topic tags/categories.
  • Discussion Page
    • The page where all the topics, questions, or discussions are listed and managed.
  • Discussion View Page/Room
    • The page where displays all the content of a certain discussion when selected. This page where displays the users dropped comments and also be managed.
  • Search Bar
    • The input where can system users enter a keyword that is related to a discussion.
  • User Page
    • The page where only the admin users have permission to access and manage the user list.

How to Run

  1. Download the source code and extract the zip file.
  2. Download or set up any local web server that runs PHP script.
  3. Open the web-server database and create a new database name it forum_db.
  4. Import the SQL file located in the database folder of the source code.
  5. Copy and paste the source code to the location where your local web server accessing your local projects. Example for XAMPP('C:\xampp\htdocs')
  6. Open a web browser and browse the project. E.g [http://localhost/simple-forum-discussion-system

Admin Default Access

Username: admin

Password: admin123

I hope this Simple Forum/Discussion System project will help you with what you are looking for. Feel free to download and enhance or modify the source code.

Explore more on this website for more source codes and tutorials.

Enjoy!

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Comments

Submitted byMeka (not verified)on Thu, 09/02/2021 - 10:33

Hello there Is there a way to connect this forum to an already made login user script? I dont want users on my site to have to do multiple logins Thank ya!!

Yes, it is possible but there's a modification on the source code that needs to be done that connects/queries with the users' table. To do that, make sure to backup the unmodified source code first then identify the pages/files that use the user table. Then, modify the queries. I hope this will help you.

Submitted byMeka (not verified)on Fri, 09/03/2021 - 10:56

Hello again!! I integrated this script into my code and it works however Im getting an error: Uncaught Error: Call to a member function fetch_assoc() on bool Here is the code:
  1. $tags = $conn->query("SELECT * FROM categories order by username asc");
  2. while($row=$tags->fetch_assoc()):
Thank ys for all of your help..greatly appreciated :)
Submitted byoretnom23on Sat, 09/04/2021 - 08:34

In reply to by Meka (not verified)

Hi. Check your database if the `categories` table exists and so the `username` column in the table. You can also check the SQL query in your PHPMyAdmin in the SQL Tab of the database to get more detailed information for the mistake in the query.

Submitted byMeka (not verified)on Fri, 10/15/2021 - 10:07

Hey again :) First off THANK YA for the script...its really cool and I got it to blend in with my site. Question: I have this error: Fatal error: Uncaught Error: Call to a member function fetch_array() on bool in /homepages/23/d815730660/htdocs/manage_user.php:6 Stack trace: #0 {main} thrown in /homepages/23/d815730660/htdocs/manage_user.php on line 6 This is the code: $user = $conn->query("SELECT * FROM users where id =".$_GET['id']); foreach($user->fetch_array() as $k =>$v){ $meta[$k] = $v; Couldn't figure out how to correct it. Thank ya so very much <3
Submitted bykulsom (not verified)on Mon, 12/13/2021 - 00:21

hello! thanks for the code but when I login as admin using the password u provided it shows wrong username or password
Submitted bynu11secur1ty (not verified)on Mon, 12/13/2021 - 21:04

Hello, dear developer, you have a lot of problems with your systems, for this system, they are Multiple -SQL-Injections.
Submitted byAdding pages i… (not verified)on Sat, 12/18/2021 - 01:13

Hello, newbie here. How do I add a page to the navbar on the left? Tyia
Submitted byDennis Chu (not verified)on Sat, 01/22/2022 - 22:15

Where can I download source code?
Submitted byLeotakamaya (not verified)on Fri, 04/29/2022 - 05:19

Hello, Thanks for the code . . . but, i want to ask something because PHP Version problem . . . I got Notice: Trying to access array offset on value of type null in xxx\xsmpp\xxx\xxx\view_forum.php on line 67 can u help it with it ?
Submitted byLeotakamaya (not verified)on Fri, 04/29/2022 - 05:22

Hello, i like ur code . . . but there's problem due different version . . . i use PHP 7.4 and got error on the code. Notice: Trying to access array offset on value of type null in view_forum.php on line 67 Can u give me some help for it ?

Add new comment