A polished PHP web application that demonstrates core social networking functionality, including secure login, profile access, friend management, and user discovery. This project is a strong example of beginner-friendly full-stack development using PHP, MySQL, and session-based authentication.
- Clean login experience with form validation
- Session-based authentication for protected pages
- User profile display with personal information
- Friend management features such as add and remove actions
- Simple, responsive interface built with plain PHP and HTML
- PHP
- MySQL
- PDO
- XAMPP
- HTML/CSS (basic structure)
- login.php — handles user authentication and login flow
- register.php — allows new users to create an account
- social_network.php — displays the dashboard, profile, friends, and user suggestions
- config.php — central database configuration for the application
- XAMPP installed and running
- Apache and MySQL enabled
- A local MySQL database named SocialNetwork
- Install XAMPP if it is not already installed.
- Open the XAMPP Control Panel.
- Start Apache and MySQL.
- Copy or move this project into your XAMPP web root folder:
- /Applications/XAMPP/xamppfiles/htdocs/
- The project folder should be accessible as:
- Open phpMyAdmin in your browser:
- Click New.
- Create a database named SocialNetwork.
- Select the database and create the required tables.
CREATE TABLE users (
username VARCHAR(10) PRIMARY KEY,
fullname VARCHAR(100),
email VARCHAR(100),
password VARCHAR(255) NOT NULL
);CREATE TABLE friends (
user VARCHAR(10),
friend VARCHAR(10),
PRIMARY KEY (user, friend)
);You can create an account through the app by visiting:
Choose a strong password that is:
- at least 8 characters long
- unique
- not reused from another website
- not a common weak password
If you prefer to add a user directly in the database, use this SQL:
INSERT INTO users (username, fullname, email, password)
VALUES ('admin', 'Admin User', 'admin@example.com', '$2y$10$8QK0uW8G1hVJqYd2l0hJ8eYh6D8iKQ8Y7Q1k3r4f8U7t3wY7ZlJ6');Open your browser and go to:
- The current project uses a local MySQL connection through XAMPP.
- If you change the database name, username, or password in the PHP files, make sure the connection details match your local setup.