Skip to content

SnapGallery — PHP Image Gallery with Lightbox, Upload & Admin

2 downloads 84 views Updated 2 weeks ago
SnapGallery — PHP Image Gallery with Lightbox, Upload & Admin
Price
Free
No cost
Downloads
2
Category
PHP Scripts
Last update
Oct 19, 2026
License
MIT / Free use
Reviewed by our team before publishing

About this code

SnapGallery — PHP Image Gallery with Lightbox, Upload & Admin

A small, self-contained PHP photo gallery script — upload photos with drag & drop, browse them in a responsive dark-mode grid, view full-size in a smooth lightbox, and manage everything from a password-protected admin page. No database needed — works on any shared PHP hosting in under 2 minutes.

Features

  • Drag & drop photo upload — drop multiple images at once with live previews, or click to browse (JPG, PNG, GIF, WebP up to 5 MB each)
  • Lightbox viewer — click any photo for full-size view with previous/next buttons, keyboard navigation (arrow keys + Esc), and a photo counter
  • Auto thumbnails — server-side thumbnails via GD when available, graceful CSS fallback on hosts without GD
  • Password-protected admin panel — log in and delete photos with one click; sessions keep the panel secure
  • Real security built in — real MIME validation (not just file extension), randomized filenames, .htaccess blocks script execution in the uploads folder, XSS-safe output everywhere
  • Zero dependencies — pure PHP + vanilla HTML/CSS/JS, no frameworks, no database, no build step; responsive design that works on mobile

What's Inside

  • index.php — public gallery: grid, upload form, lightbox
  • upload.php — upload handler with validation (AJAX, JSON)
  • admin.php — admin login + photo delete page
  • config.php — settings: admin password, upload rules, thumbnail sizes
  • includes/functions.php — helpers: uploads, thumbnails, security
  • assets/style.css, assets/script.js — dark theme + lightbox JS
  • README.txt — 2-minute setup guide

Setup

1. Upload the folder to your web host. 2. Open it once — the data, uploads and thumbs folders are created automatically. 3. Change the admin password in config.php (default: gallery123). Done!

Perfect For

Portfolio sites, event photo pages, client proofing galleries, wedding/family photo sharing, or learning how file uploads, thumbnails and sessions work in PHP.

Need a Custom Website or Mobile App?

Downloading free code is just the start. Yadu Tech builds complete websites and mobile apps for businesses — design, development, deployment, all done for you.

👉 Chat on WhatsApp

Features & includes

Full source code
Easy setup
Clean, modular code
Responsive design

You might also like

More in PHP Scripts
Currency Converter — Convert 10 World Currencies Instantly (PHP)
Free
PHP Scripts • 5d ago

Currency Converter — Convert 10 World Currencies Instantly (PHP)

Currency Converter — Convert 10 World Currencies Instantly (PHP) A single-page PHP currency converter for Indian businesses, freelancers and...

2 50
Free
GymFit Pro — Gym & Fitness Membership Management System (PHP + SQLite)
Premium
PHP Scripts • 6d ago

GymFit Pro — Gym & Fitness Membership Management System (PHP + SQLite)

🏋️ GymFit Pro — Complete Gym & Fitness Membership Management System GymFit Pro is a ready-to-run membership system for gyms, fitness studios...

0 63
₹299
PollMaster PHP — Simple Poll & Voting System with Vote-Once Protection
Free
PHP Scripts • 1w ago

PollMaster PHP — Simple Poll & Voting System with Vote-Once Protection

PollMaster PHP — Simple Poll & Voting System (No Database Needed) PollMaster ek chhota, self-contained PHP poll aur voting system hai. Bina...

1 54
Free
SnapGallery — PHP Image Gallery with Lightbox, Upload & Admin
Free
Download