Skip to content

SnapGallery — PHP Image Gallery with Lightbox, Upload & Admin

2 downloads 167 views Updated 1 month 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
PHP Password Generator — Secure Random Passwords with Strength Meter & One-Click Copy
Free
PHP Scripts • 2d ago

PHP Password Generator — Secure Random Passwords with Strength Meter & One-Click Copy

Secure random passwords, generated on your own server Tired of weak passwords like rahul123? This small PHP script generates strong, random...

1 35
Free
LibraPro — Library Management System (PHP + SQLite)
Premium
PHP Scripts • 6d ago

LibraPro — Library Management System (PHP + SQLite)

📚 LibraPro — Library Management System (PHP + SQLite) A complete, ready-to-deploy management system for small libraries, school libraries a...

1 67
₹299
PHP Image Resizer & Watermarker — Resize Images & Add Text Watermark (GD)
Free
PHP Scripts • 1w ago

PHP Image Resizer & Watermarker — Resize Images & Add Text Watermark (GD)

Resize any photo in seconds — no Photoshop, no sign-up Upload a photo, pick the width you need, and download a perfectly resized copy — with...

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