← Course
PHP for Beginners
Server-side PHP from zero: variables & types, arrays, functions, forms, MySQL, sessions, simple CRUD, and basic security (SQL injection, XSS, password hashing).
PHPLast updated 3 Feb 2026
Level 1: PHP Basics (The Server Chef)
Focus on understanding that PHP runs on the server, not in the browser.
Session 1: Intro & Local Server
- How is PHP different from JavaScript? (Client-side vs server-side).
- Install XAMPP or Herd and run your first
.phpfile. - PHP tags
<?php ... ?>and outputting text with echo.
Session 2: Data Containers (Variables & Types)
- Creating variables with the dollar sign $.
- Types: String, Integer, Float, Boolean.
- Concatenation: joining strings with the dot (
.).
Session 3: Logic & Branching
- Basic arithmetic operators.
- If, Else, Elseif: making decisions on the server.
- Switch case for many possible choices.
Level 2: Arrays & Modular Code
Learn to work with lots of data and keep files organized.
Session 4: PHP Arrays
- Indexed arrays: simple lists of data.
- Associative arrays: data with keys/names (e.g.
['name' => 'Nasir']). - Looping with foreach (used everywhere in PHP).
Session 5: Functions & Includes
- Writing your own functions so code can be reused.
- Include & Require: splitting HTML into separate files (e.g.
header.phpandfooter.php) so you don’t edit the same blocks everywhere.
Level 3: Forms & Database (The Life of a Website)
Here you build sites that actually do something useful.
Session 6: Handling Forms
- GET vs POST: when to use which.
- Reading user input (name, email, etc.).
- Showing the submitted data back on the page.
Session 7: Database Connection (MySQL)
- Introduction to phpMyAdmin.
- Connecting PHP to the database (mysqli or simple PDO).
- Create & Read: displaying database rows in an HTML table.
Session 8: Simple Project (Guestbook / Contact)
- Build a simple “Guestbook” app (PHP + MySQL + HTML form):
- User fills a form.
- Data is saved to the database.
- A page lists everyone who submitted.
Level 4: State & Security (Making a “Smart” Website)
PHP starts to show its strength: the server can remember who is using the site.
Session 9: Session & Cookie (Website Memory)
- session_start(): how the site “remembers” a logged-in user across pages.
- Simple Login & Logout.
- Restricting access (e.g. only logged-in users can open
admin.php).
Session 10: Full CRUD (Update & Delete)
- In Level 3 you did Create & Read. Here: Update (edit) and Delete.
- Using $\_GET['id'] to choose which record to edit or delete.
Session 11: Basic Security (Anti-Hacker)
- SQL Injection: why you must not put variables directly in queries (introduction to prepared statements).
- XSS: preventing malicious input like
<script>alert('hack')</script>in forms. - Password hashing: never store plain passwords—password_hash() and password_verify().
Interested in this course? I offer mentoring and structured learning—get in touch to discuss your goals.