self-hosted
contact-form
A tiny PHP contact-form backend with honest spam defense · GitHub
Try it
Curl
TS=$(($(date +%s) - 10))
curl -X POST http://localhost:8000/submit \
-H "Content-Type: application/json" \
-d "{\"name\":\"Alice\",\"email\":\"alice@example.com\",\"subject\":\"Hello\",\"message\":\"This is a longer test message.\",\"_ts\":$TS}"
Spam defense
- Honeypot: invisible
_honeypot field — populated => 422.
- Time gate: submission must be ≥3s after render — faster => 422.
- Rate limit: 5 submissions / IP / hour — over => 429.
Routes
POST /submit — accept form
GET /submissions — list (Bearer ADMIN_TOKEN)
GET /health — service health