Hosting · Free guide

How contact forms work on a free static website (without spam or a database)

A static HTML form simply sends a POST request cleanly to an API endpoint rather than a traditional PHP server. You can connect a form to zero-code endpoints (like Formspree or Basin) in five minutes, or deploy a built-in Cloudflare Pages Function guarded by Cloudflare Turnstile, honeypot traps, and optional D1 storage.

By StaticLaunch · Four Media Group LLC

Option 1: Hosted static form endpoints (Fastest start)

For a pure static HTML site without serverless code, services like Formspree or Basin receive your HTML <form action='...' method='POST'> payload cleanly and forward verified inquiries straight to your inbox.

Option 2: Own everything with Cloudflare Pages Functions + Turnstile

For complete ownership inside your Cloudflare account with zero third-party per-form brand fees, handle form submissions inside functions/api/ using Cloudflare Turnstile siteverify, strict origin allowlists, and an isolated Email Worker or D1 table.

  • Public Turnstile sitekey lives safely in HTML.
  • Private TURNSTILE_SECRET stays strictly inside encrypted Cloudflare environment secrets.
  • D1 stores encrypted backup records even if an SMTP relay blips.

Never accept submissions without server-side validation & spam checks

Browser required attributes help human UX, never security. Every backend endpoint must validate email format, enforce character lengths, reject filled honeypots, and verify Turnstile tokens via Cloudflare's siteverify endpoint before saving or emailing.

Common questions

Why not just publish a raw mailto: link instead of a form?

Providing a clickable email address (or phone number) alongside a Turnstile-protected form helps visitors using any device while minimizing automated scraper spam.

Is Cloudflare Turnstile free?

Yes—Cloudflare Turnstile provides generous bot verification without showing annoying visual traffic-light puzzles to normal visitors.

References

Provider interfaces and limits can change. Consult the original documentation before changing production settings.