Skip to content

SnapGallery — PHP Image Gallery with Lightbox, Upload & Admin

2 downloads 3 views Updated 2 hours 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
InvoicePro — GST Invoice & Client Management System (PHP + MySQL)
Premium
PHP Scripts • 1h ago

InvoicePro — GST Invoice & Client Management System (PHP + MySQL)

InvoicePro — GST Invoice & Client Management System (PHP + MySQL) A complete, ready-to-deploy invoicing system for Indian small businesses,...

1 5
₹399
AuthKit PHP — Secure Login & Signup System with bcrypt, CSRF & Session Protection
Free
PHP Scripts • 5d ago

AuthKit PHP — Secure Login & Signup System with bcrypt, CSRF & Session Protection

AuthKit PHP — Secure Login & Signup System A complete, self-contained user authentication system in pure PHP: signup + login + protected das...

1 41
Free
Contact Form with Validation — PHP Contact Form Script
Free
PHP Scripts • 1w ago

Contact Form with Validation — PHP Contact Form Script

Contact Form with Validation — a secure, ready-to-use PHP contact form for any website. Just edit config.php with your email, upload to any...

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