leads
Contact form on Hostinger (PHP)
Updated 2026-07-19leads/hostinger-php.md
Contact form on Hostinger (PHP)
Primary lead path after the Hostinger static move (2026-07-19).
Browser → POST /api/lead.php → PHP mail() → darshan@x9elysium.com
↘ auto-reply to lead (best effort)
Source: public/api/lead.php
Client: app/contact/ContactClient.tsx posts to /api/lead.php.
What you need on Hostinger
- PHP enabled on the plan (default for shared hosting).
- After each deploy, confirm these files exist under
public_html/:api/lead.php.htaccess(rewrites/api/lead→lead.phpas well)
- Email that can send — PHP
mail()usually works when:- Domain DNS MX is on Hostinger, or
- You have a mailbox like
darshan@x9elysium.comon Hostinger
If mail never arrives
hPanel → Emails → create
darshan@x9elysium.com(or keep your existing mailbox).hPanel → Emails → Deliverability — enable SPF/DKIM if offered.
Test:
curl -s -X POST 'https://x9elysium.com/api/lead.php' \ -H 'Content-Type: application/json' \ -d '{ "firstName":"Smoke", "lastName":"Test", "email":"your-throwaway@example.com", "message":"Hostinger PHP lead smoke test from CLI." }'Expect:
{"ok":true}and an inbox message.If response is
502, Hostinger is blockingmail(). Options:- Open a Hostinger ticket: “enable PHP mail() for domain x9elysium.com”
- Or set up SMTP later (not in this file — keep simple)
Spam gates (built in)
| Gate | Behavior |
|---|---|
Honeypot _gotcha |
Silent 200, no email |
Dwell _ts < 2s |
Silent 200, no email |
| Validation | 422 + field list |
| Per-IP rate (8/hour) | 429 |
Deploy note
FTP deploy of out/ includes api/lead.php automatically (copied from public/). No extra step if you upload the full build.
Manual smoke after upload
# Endpoint alive (POST)
curl -i -X POST https://x9elysium.com/api/lead.php \
-H 'Content-Type: application/json' \
-d '{"firstName":"A","lastName":"B","email":"a@b.com","message":"ten chars min"}'
Notes from readers
Open thread. Anyone can reply — no signup. Be real, be specific. Anything with a link goes through review.
Loading…