A signup form in the closing section posts to subscribe.php (ships in the build): PDO/MySQL, honeypot, idempotent insert, optional mail() notify. DB creds live in a gitignored config kept above the web root; schema and setup in server/. Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
1.2 KiB
1.2 KiB
Launch-list backend (cPanel)
The email capture on the site posts to subscribe.php, which ships in the build
(public/subscribe.php → dist/subscribe.php). To wire it up on cPanel:
- Create the DB in cPanel → MySQL Databases. Note db name, user, password.
- Create the table: run
schema.sqlin phpMyAdmin against that DB. - Add credentials: copy
subscribe.config.example.phptosubscribe.config.php, fill in the DB values, and upload it one level above the subdomain's docroot (so it is never web-servable).subscribe.phplooks there first. - Deploy the built
dist/into the subdomain docroot.subscribe.phpis already inside it. - Smoke test:
Expect
curl -i -X POST -H 'X-Requested-With: fetch' \ --data 'email=test@example.com' \ https://green-tea.expressive-tea.io/subscribe.php{"ok":true,...}and a row insubscribers.
Notes:
- Duplicate signups are a silent success (unique index on
email). - A hidden honeypot field blocks basic bots.
- No-JS visitors are redirected to
/?subscribed=1; with JS they get inline feedback. - No rate limiting yet — add one at the cPanel/CDN layer if signups get abused.