Skip to content

KarthikRV1107/Blogpost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

37 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Web Application Using PHP & MySQL

πŸ“Œ Project Overview

This project is a simple web application built with PHP and MySQL, designed to demonstrate the following:

  • Setting up a local development environment.
  • Performing CRUD (Create, Read, Update, Delete) operations.
  • Implementing user authentication.
  • Adding search and pagination features.
  • Securing the application with prepared statements, form validation, and role-based access control.

🎯 Objectives

  • βœ… Set up a local PHP development environment.
  • βœ… Use Git and GitHub for version control.
  • βœ… Build a functional CRUD application.
  • βœ… Implement user authentication.
  • βœ… Enhance the app with search, pagination, and improved UI.
  • βœ… Secure the app against common web vulnerabilities.
  • βœ… Deliver a complete, tested final project.

πŸ—‚οΈ Project Structure

project-root/

β”‚

β”œβ”€β”€ index.php(blogpost.php)

β”œβ”€β”€ db.php

β”œβ”€β”€ /includes

β”‚ β”œβ”€β”€ header.php

β”‚ β”œβ”€β”€ footer.php

β”‚ └── ...

β”œβ”€β”€ /auth

β”‚ β”œβ”€β”€ register.php

β”‚ β”œβ”€β”€ login.php

β”‚ β”œβ”€β”€ logout.php

β”œβ”€β”€ /posts

β”‚ β”œβ”€β”€ create.php

β”‚ β”œβ”€β”€ read.php

β”‚ β”œβ”€β”€ update.php

β”‚ β”œβ”€β”€ delete.php

β”œβ”€β”€ README.md

└── ...


βš™οΈ Setup Instructions

1️⃣ Install Local Server Environment

  • Download and install XAMPP, WAMP, or MAMP.
  • Start Apache and MySQL services.
  • Access http://localhost to verify.

2️⃣ Install Code Editor

  • Recommended: Visual Studio Code or Sublime Text.
  • Add relevant PHP extensions for syntax highlighting and debugging.

3️⃣ Set Up Version Control

  • Install Git.
  • Create a GitHub account.
  • Clone this repository or initialize one in your project folder:
    git init
    git remote add origin https://github.com/YOUR_USERNAME/YOUR_REPO.git
    

Make your first commit: git add .

git commit -m "Initial commit: Project structure setup"

git push -u origin main

πŸ—ƒοΈ Database Setup Create a MySQL database named blog.

Tables:

users β€” (id, username, password, role)

posts β€” (id, title, content, created_at)

πŸš€ Features

βœ… Basic CRUD

Add new posts.

View all posts.

Edit posts.

Delete posts.

πŸ”’ User Authentication

User registration & login.

Password hashing.

Session management.

πŸ”Ž Search & Pagination

Search posts by title/content.

Paginated posts list.

πŸ” Security

Prepared Statements with PDO/MySQLi.

Server-side & client-side form validation.

Role-based access control (admin, editor, etc.).

πŸ“… Project Timeline

Task Description Timeline
Task 1 Environment Setup 3 Days
Task 2 Basic CRUD Application 10 Days
Task 3 Advanced Features (Search, Pagination, UI) 10 Days
Task 4 Security Enhancements 10 Days
Task 5 Final Integration & Testing 12 Days

βœ… Deliverables

βœ”οΈ Local server environment ready.

βœ”οΈ Version-controlled project repository.

βœ”οΈ Fully functional CRUD application with authentication.

βœ”οΈ Search and pagination features.

βœ”οΈ Secure code with prepared statements and validation.

βœ”οΈ Documentation for database and security measures.

πŸ“š Documentation

Database schema: see docs/database_schema.sql

Security notes: see docs/security.md

🀝 Contributing

Pull requests and improvements are welcome!

Please fork this repository, create a branch, and submit a pull request.

πŸ“„ License

This project is for educational purposes. Feel free to modify and reuse.