Beginner5 minUpdated Mar 27, 2026

How to Handle HTML Forms with PHP and FormsList

Replace custom PHP form handlers with FormsList. No more mail(), PHPMailer, or server-side validation code — just point your HTML form to FormsList.

Prerequisites

  • An existing HTML form (on a PHP site or any web host)
  • A FormsList account (free)

TL;DR

Instead of writing PHP form handlers with mail() or PHPMailer, point your HTML form to `https://formslist.com/f/your-form-id`. FormsList replaces custom PHP backends with a managed service that includes spam filtering, notifications, and integrations.

1

Create a FormsList form endpoint

Sign up for a free FormsList account and create a new form. Copy the endpoint URL. This replaces your PHP form handler script entirely — no more process-form.php or send-email.php files.

2

Update your HTML form action

Replace your form's action attribute — instead of pointing to a PHP script, point it to your FormsList endpoint. The rest of your HTML form stays exactly the same.

<!-- Before: pointing to a PHP handler -->
<!--
<form action="process-form.php" method="POST">
-->

<!-- After: pointing to FormsList -->
<form action="https://formslist.com/f/YOUR_FORM_HASH" method="POST">
  <div style="margin-bottom: 1rem;">
    <label for="name" style="display: block; font-weight: 600;">Name</label>
    <input type="text" id="name" name="name" required
      style="width: 100%; padding: 0.5rem; border: 1px solid #ccc; border-radius: 4px;" />
  </div>

  <div style="margin-bottom: 1rem;">
    <label for="email" style="display: block; font-weight: 600;">Email</label>
    <input type="email" id="email" name="email" required
      style="width: 100%; padding: 0.5rem; border: 1px solid #ccc; border-radius: 4px;" />
  </div>

  <div style="margin-bottom: 1rem;">
    <label for="message" style="display: block; font-weight: 600;">Message</label>
    <textarea id="message" name="message" rows="5" required
      style="width: 100%; padding: 0.5rem; border: 1px solid #ccc; border-radius: 4px;"></textarea>
  </div>

  <!-- Optional: redirect after submission -->
  <input type="hidden" name="_redirect" value="https://yoursite.com/thanks.html" />

  <button type="submit"
    style="padding: 0.6rem 1.5rem; background: #2563eb; color: #fff; border: none; border-radius: 4px; cursor: pointer;">
    Send Message
  </button>
</form>
3

Remove your PHP handler and test

You can safely delete or archive your old PHP form handler script (process-form.php, contact.php, etc.). Submit a test message and verify it appears in your FormsList dashboard. Enable email notifications so submissions are forwarded to your inbox. FormsList handles spam filtering, validation, and delivery — all the things your PHP script used to do.

Frequently Asked Questions

Ready to collect form submissions?

Set up your form backend in under a minute. No server required, no complex configuration — just a simple endpoint for your forms.