๐งฉ Week 8 โ PHP Basics + Form Handling
Goal: Understand PHP fundamentals, how to handle form data, sessions, and simple backend functionality.
๐ Daily Outline
Day 1 โ PHP Syntax & Data Types
๐ง Topics:
- What is PHP? Introduction & History
- PHP setup (XAMPP or Laragon)
- Basic Syntax: echo, comments, tags
- Variables and Constants
- Data Types: string, int, float, boolean, array
๐ Activities:
- Install & run local server (XAMPP)
- Hello World in PHP
- Variable declaration exercises
- Practice identifying data types
Day 2 โ Functions, Conditionals & Loops
๐ง Topics:
- if, else, elseif, switch
- for, while, do-while loops
- Functions: define, call, return
- Scope (global, local)
๐ Activities:
- Write a calculator function
- Loop to print multiplication table
- Quiz: Predict output of given code snippets
Day 3 โ Working with Forms in PHP
๐ง Topics:
- HTML Form Review
- PHP $\GET vs $\POST
- Form handling logic
- Form validation (required, empty, numeric)
๐ Activities:
- Build a feedback/contact form
- Handle and display submitted data using POST
- Add basic validation rules
Day 4 โ Include, Require, and Sessions
๐ง Topics:
- include vs require vs include\_once
- Creating modular pages (e.g., header.php, footer.php)
- Starting and managing sessions
- $\SESSION and $\COOKIE basics
๐ Activities:
- Create a 3-page website with shared header/footer
- Build login system using sessions
- Practice: show logged-in username on dashboard
Day 5 โ File Upload & Handling
๐ง Topics:
- enctype="multipart/form-data"
- $\_FILES array
- Validating file types/sizes
- Moving uploaded files to server
๐ Activities:
- Create an image upload form
- Display uploaded image after submission
- Restrict upload to only .jpg/.png under 2MB
Day 6 โ Mini Project: Contact Form with File Upload
๐ฏ Combine:
- PHP + Form + File Upload + Validation
- Create a styled contact form
- Store data in session or file
- Show thank you message upon successful submission
Day 7 โ Quiz & Practice
๐งช Activities:
- PHP quiz (variables, control flow, $\_POST, sessions)
- Bug fix exercises
- Build: Registration form with validation (Name, Email, Password, Confirm)