Simple Chat System using PHP, jQuery, and Ajax with Source Code

Language

This is a Simple Chat System created using PHP/MySQLi and AJAX/jQuery. It features a chat room that is locked by a password depending on the creator of the room. The chats in the room are shown using AJAX/jQuery. This chat system also has an admin panel. The admin user can manage all data of the system except for the chats but he/she can manage/join the room even the user created the room with a password. The admin user can also manage the list and details of users. Talking about the chat room conversation box, the messages are automatically updating with help of the setInterval function.

This Simple Chat System was developed using HTML, PHP, MySQL Database, CSS, Javascript (Ajax and jQuery), and Bootstrap for the design. The bootstrap sources are not yet included along with the source code, I have used only the bootstrap's CDN's.

Features

  • Admin Side
  • User Registration
  • Login/Logout
  • Manage Account Details
  • Update User Photo
  • Lobby
  • User's Chatroom List Panel
  • Chatroom List Panel
  • Create Chat Room
  • Chat Room Conversation Box
  • Send message in a Chat Room
  • Join/Leave Chat Room

How to Run

Requirements

  • Download and Install any local web server such as XAMPP/WAMP.
  • Download the provided source code zip file. (download button is located below)

Installation/Setup

  1. Open your XAMPP/WAMP's Control Panel and start the "Apache" and "MySQL".
  2. Extract the downloaded source code file.
  3. If you are using XAMPP, copy the extracted source code folder and paste it into the XAMPP's "htdocs" directory. And If you are using WAMP, paste it into the "www" directory.
  4. Browse the PHPMyAdmin in a browser. i.e. http://localhost/phpmyadmin
  5. Create a new database naming "chat_system".
  6. Import the provided SQL file. The file is known as "chat_system.sql" located inside the "db" folder.
  7. Browse the Simple Chat System in a browser. i.e. http://localhost/chat_system

You can test it with 2 different browsers and users.

Admin Access

Username: admin
Password: admin

DEMO

That's it! I hope this Simple Chat System Project in PHP and Ajax/jQuery will help you with what you are looking for and you will learn a lot from this project. Feel Free to modify the way you wanted.

Happy Coding :)

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 bytofunon Sat, 10/14/2017 - 15:51

chat cannot real time, must be refresh if see next chat. how to setting auto refresh or real time chat?
Submitted byVansh (not verified)on Sun, 01/21/2018 - 01:11

it would have been best to see whos logged on
Submitted byridhul (not verified)on Sat, 09/08/2018 - 03:12

chat cannot real time, must be refresh if see next chat. how to setting auto refresh or real time chat?

$(document).ready(function(){ setInterval(displayChat,1000); }); Paste this code in chatroom.php both user and admin folder
Submitted byVishal12312 (not verified)on Sun, 08/15/2021 - 02:04

This is the Best... Thank You Sir!
Submitted byRahul Dindorde (not verified)on Sat, 12/11/2021 - 01:52

can you pleas share your admin panel username and password for login purpose
Submitted byGiuseppeElia (not verified)on Tue, 01/03/2023 - 23:28

hello, I have a problem in registering in which no new user is added to the database..how can I solve it? thank you
Submitted bytami (not verified)on Thu, 03/09/2023 - 20:50

hello, I have a problem with sending typed messages on the chat , there are not sending. and secondly while on the admin side I cannot add new members as well. hopefully there is a solution for this.

Add new comment