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.

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.

By Vaibhav Jain·Published March 27, 2026

Prerequisites

  • An existing HTML form (on a PHP site or any web host)
  • A FormsList account (free)
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

What if I need server-side validation?

FormsList validates required fields and email formats automatically. For custom validation logic, use HTML5 validation attributes (required, pattern, type) and client-side JavaScript. FormsList also provides spam filtering that replaces manual CAPTCHA handling in PHP.

Can I migrate an existing PHP form to FormsList?

Yes. Keep your existing HTML form markup and only change the action attribute from your PHP script URL to your FormsList endpoint URL. All named input fields are captured automatically. No code changes beyond the action URL.

Does this work on shared hosting like cPanel?

Yes. Since the form submits to an external FormsList endpoint, it works on any hosting environment: shared hosting, cPanel, LAMP stacks, or even static file hosting. You do not need PHP installed at all.

Ready to collect form submissions?

200 free submissions a month and a live endpoint in 30 seconds. No server, no credit card, just point your form at it.

Sign up with emailView pricing