This is a real-time chat application built with PHP and JavaScript. It allows users to register, log in, and engage in one-on-one conversations with other users. The application features real-time message updates, online/offline status indicators, and a user-friendly interface.
- User registration and authentication
- Real-time messaging
- Online/offline status updates
- User search functionality
- Profile management (including profile picture uploads)
- Responsive design for desktop and mobile devices
- PHP 7.4+
- MySQL
- JavaScript (with AJAX for real-time updates)
- HTML5
- CSS3
- Font Awesome for icons
-
Clone the repository: git clone [[(https://github.com/BenDev202/chat-app-php-and-mysql.git)]
-
Set up your web server (e.g., Apache) to serve the project directory.
-
Create a MySQL database for the application.
-
Import the database schema: mysql -u your_username -p your_database_name < database.sql
-
Configure the database connection:
- Open
config.php - Update the database credentials:
$db_host = 'localhost'; $db_name = 'your_database_name'; $db_user = 'your_username'; $db_pass = 'your_password';
- Ensure the
uploadsdirectory has write permissions:
-
Access the application through your web browser.
-
Register a new account or log in with existing credentials.
-
On the main page, you'll see a list of all users. Click on a user to start a chat.
-
Use the search bar to find specific users.
-
Click on your profile picture to access profile management options.
index.php: Landing page and login formsignup.php: User registration pageuser.php: Main user interface showing all userschat.php: Individual chat interfaceprofile.php: User profile pageedit-profile.php: Profile editing pageconfig.php: Database configurationstyle.css: Main stylesheetjavascript/: Directory containing JavaScript filesusers.js: Handles user list functionalitychat.js: Manages real-time chat functionality
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open source and available under the MIT License.
If you have any questions, feel free to reach out to armandbenjamin30@gmail.com.





