A legacy PHP e-commerce platform for selling and redeeming local gift certificates. Developed circa 2008–2010, retired in 2012.
CheapLocalDeals.com connects local businesses (advertisers) with customers looking for discounted gift certificates. Customers browse geo-targeted deals, purchase certificates online, and print or download them. Advertisers manage listings, certificate amounts, and redemptions through a merchant portal. The site also includes affiliate tracking, a white-label XML/KML API, and a separate mobile site.
| Layer | Technology |
|---|---|
| Language | PHP 5.x (legacy patterns) |
| Web server | Apache + mod_rewrite |
| Database | MySQL via PEAR MDB2 |
| Cache | Memcached (required) |
| Sessions | PHP sessions + DB sessions table |
| FPDF 1.6 | |
| Geolocation | MaxMind GeoLite City (GeoLiteCity.dat) |
| Payments | Authorize.net / LinkPoint, PayPal Express Checkout |
| Frontend | jQuery 1.4.2, jQuery UI, FCKEditor |
├── admin/ Site administrator panel
├── advertiser_admin/ Merchant portal
├── advertiser-signup/ Multi-step advertiser registration
├── affTrack/ Affiliate self-service dashboard
├── affiliates/ Affiliate management (admin-gated)
├── checkout/ Shopping cart and payment processing
├── customer_admin/ Customer account portal
├── includes/ Core framework (config, classes, templates, libs)
├── mobile/ Separate mobile site
├── sections/ Public page scripts (search results, location info)
├── tools/ Maintenance utilities (sitemaps, cache admin)
├── index.php Fixed-route entry point
├── redirect.php SEO-friendly URL resolver
└── .htaccess URL rewriting and caching rules
| Document | Description |
|---|---|
| Architecture | Request flow, portals, routing, and core classes |
| Setup Guide | Server requirements and local development |
| Database Reference | Table inventory and data model |
| Business Workflows | Customer checkout, advertiser onboarding, affiliates |
| Configuration | Config files, settings constants, and secrets |
| Known Issues | Missing files, legacy debt, and security notes |
This application has no build step. Deploy the PHP tree to an Apache document root. See docs/SETUP.md for full requirements.
Critical dependencies:
- Apache with
mod_rewriteandAllowOverride All - PHP with
memcacheextension - MySQL database — import sql/schema.sql (see docs/DATABASE.md)
- Memcached running on
localhost:11211 - Writable directories at
/var/www/temp/cache/and/var/www/temp/sessions/
Note: Memcached is a hard dependency. The site will not load without it.
Developed in 2008 when mobile access was just emerging; a separate mobile site exists but was never fully polished. PEAR libraries handle most system functions. FPDF generates gift certificate PDFs. Payment integrations include Authorize.net and PayPal.
The site was retired in 2012, two years after the original employer stopped commissioning updates (last code changes ~June 2010). The client returned the source rather than continue paying ~$200/month hosting for the large geo-targeted site.
Geolocation used a flat-file MaxMind database updated via cron; the update script is not in this repository, but includes/libs/GeoLiteCity.dat is included.
MIT License — Copyright (c) 2015 Robert McDowell. See License.
This repository contains hardcoded production credentials (database passwords, payment gateway keys, API tokens) in includes/config.php and includes/settings.php. Rotate all secrets before any redeployment. See docs/KNOWN_ISSUES.md for details.