How to Add a Working Contact Form to a Static AI-Generated Site
You asked your AI to add a contact form to your website, and it dutifully created one with name, email, and message fields. But when you or a visitor hits "Send," nothing happens — or you get an error. That's not a bug in the AI's work. It's a fundamental fact about static websites, and here's how to fix it properly.
Why static forms don't work by themselves
A static website is just HTML files — the kind AI tools generate. There's no server behind it running code to receive a form submission, save it, and email it to you. The form looks right, but the "Send" button has nowhere to send to. To make a form actually work, you need something on the receiving end to process it.
Traditionally that meant writing backend code (PHP, Node, etc.) and running a server. For a non-technical creator, that's a huge leap. The modern answer is a form endpoint service that does the receiving part for you.
The simple solution: a form endpoint
A form endpoint is a web address that accepts your form's data, stores it, and notifies you — without you running any server. You point your form at that address, and it just works. Many hosts include this. On Hostilo, for example, every site can use a built-in form endpoint, so you don't need a separate service.
Step-by-step
1. Get your form snippet
Copy a form that points at the endpoint and includes your site's unique token. It looks like this:
<form action="https://hostilo.app/api_form.php" method="POST"> <input type="hidden" name="site_token" value="YOUR_UNIQUE_TOKEN"> <input type="email" name="email" required> <textarea name="message" required></textarea> <button type="submit">Send</button> </form>
2. Add your token
The site_token is what links submissions to your site. Copy it from your dashboard and paste it into the hidden field. This is the one piece that makes the form yours.
3. Paste it into your page
Drop the form anywhere in your HTML where you want it to appear, then save and publish. That's it — the form is now live and functional.
Tip
If you styled a form with your AI already, you can keep that design. Just make sure the form's action points at the endpoint and includes the hidden site_token field.
Where do submissions go?
When someone fills out the form, the message is emailed to you and saved in your dashboard, so you have a record even if an email gets lost. You don't have to check a separate service — it's all in one place.
What about spam?
Public forms attract spam bots. A good endpoint includes a honeypot — an invisible field that humans never fill in but bots do. When the honeypot is filled, the submission is silently rejected. This blocks most automated spam without annoying your real visitors with captchas.
Frequently asked questions
Do I need to know how to code to add a working form? No. You paste a snippet and add your token. No backend, no server, no code to write.
Can I customize how the form looks? Yes. The form is normal HTML — style it however you like, or keep the design your AI produced. Only the action URL and hidden token field need to stay.
Will I get the messages by email? Yes. Submissions are emailed to you and also saved in your dashboard as a backup.
How is spam handled? A built-in honeypot field catches and blocks most bots automatically, so you don't need captchas.
Ready to put your AI site online?
Paste your ChatGPT or Claude code, hit save, and get a live HTTPS link in seconds. Free to start, no credit card.
Publish your site free

