Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Social Network PHP Project

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.

Project Highlights

  • 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

Tech Stack

  • PHP
  • MySQL
  • PDO
  • XAMPP
  • HTML/CSS (basic structure)

Project 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

Prerequisites

  • XAMPP installed and running
  • Apache and MySQL enabled
  • A local MySQL database named SocialNetwork

Setup Instructions

1. Install and start XAMPP

  • Install XAMPP if it is not already installed.
  • Open the XAMPP Control Panel.
  • Start Apache and MySQL.

2. Place the project in the correct folder

  • Copy or move this project into your XAMPP web root folder:
    • /Applications/XAMPP/xamppfiles/htdocs/
  • The project folder should be accessible as:

3. Create the database

  • Open phpMyAdmin in your browser:
  • Click New.
  • Create a database named SocialNetwork.
  • Select the database and create the required tables.

4. Create the users table

CREATE TABLE users (
  username VARCHAR(10) PRIMARY KEY,
  fullname VARCHAR(100),
  email VARCHAR(100),
  password VARCHAR(255) NOT NULL
);

5. Create the friends table

CREATE TABLE friends (
  user VARCHAR(10),
  friend VARCHAR(10),
  PRIMARY KEY (user, friend)
);

6. Create your first account

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');

7. Run the project

Open your browser and go to:

Notes

  • 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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages