# PHP Sites Integration Guide

Complete guide to integrate MyFormConnect with PHP Sites

      Setup time: **5 minutes
      Difficulty: **Easy
        Compatible versions: **All PHP versions**

Add MyFormConnect forms to any PHP website or framework (Laravel, Symfony, CodeIgniter, CakePHP, etc.). Works with custom PHP applications and popular frameworks.

## ** Prerequisites

- ** A MyFormConnect account - [Sign up here](/users/sign_up)
- ** A form created in your MyFormConnect dashboard with its UUID copied
- ** Access to PHP files on your server
- ** Basic PHP and HTML knowledge

## ** Integration Methods

### HTML Form (Recommended)

                5 minutes

                Easy

Add a MyFormConnect form directly to your PHP templates or views. Works with any PHP setup.

                  1

#### Copy your form UUID

                    Get your form UUID from MyFormConnect dashboard.

1. Log in to your MyFormConnect dashboard
2. Open the form you want to use
3. Copy the form UUID (e.g. `550e8400-e29b-41d4-a716-446655440000`)

                  2

#### Add form to PHP template

                    Insert the form HTML into your PHP file.

1. Replace `YOUR_FORM_UUID` with your actual UUID
2. Save the PHP file
3. Upload to your server if needed

```
<!-- In your PHP template (e.g., contact.php, view.php) -->

<div class="contact-form">
  <h2>Contact Us</h2>

  <form action="https://myformconnect.io/f/YOUR_FORM_UUID" method="POST" data-mfc="true">
    <div style="margin-bottom: 15px;">
      <label for="name">Name *</label><br>
      <input type="text" id="name" name="name" required style="width: 100%; padding: 8px; border: 1px solid #ccc;">
    </div>

    <div style="margin-bottom: 15px;">
      <label for="email">Email *</label><br>
      <input type="email" id="email" name="email" required style="width: 100%; padding: 8px; border: 1px solid #ccc;">
    </div>

    <div style="margin-bottom: 15px;">
      <label for="message">Message</label><br>
      <textarea id="message" name="message" rows="4" style="width: 100%; padding: 8px; border: 1px solid #ccc;"></textarea>
    </div>

    <button type="submit" style="padding: 10px 20px; background: #777bb4; color: white; border: none; cursor: pointer;">Send Message</button>
  </form>

  <script src="https://myformconnect.io/loader.js" data-client-id="YOUR_FORM_UUID"></script>
</div>
```

##### Important Note

                            This works with plain PHP, Laravel Blade, Symfony Twig, and any other PHP templating engine.

                  3

#### Laravel Blade example

                    For Laravel users, add to Blade templates.

```
{{-- resources/views/contact.blade.php --}}

@extends('layouts.app')

@section('content')
<div class="container">
  <h2>Contact Us</h2>

  <form action="https://myformconnect.io/f/YOUR_FORM_UUID" method="POST" data-mfc="true">
    <div class="form-group">
      <label for="name">Name *</label>
      <input type="text" id="name" name="name" class="form-control" required>
    </div>

    <div class="form-group">
      <label for="email">Email *</label>
      <input type="email" id="email" name="email" class="form-control" required>
    </div>

    <div class="form-group">
      <label for="message">Message</label>
      <textarea id="message" name="message" class="form-control" rows="4"></textarea>
    </div>

    <button type="submit" class="btn btn-primary">Send Message</button>
  </form>

  <script src="https://myformconnect.io/loader.js" data-client-id="YOUR_FORM_UUID"></script>
</div>
@endsection
```

##### Important Note

                            Use your existing CSS classes (like Bootstrap) for styling.

                  4

#### Test

                    Verify submissions reach MyFormConnect.

1. Visit the page with the form
2. Fill out and submit the form
3. Check MyFormConnect dashboard under **Leads**

### Include in Header (Site-wide)

                8 minutes

                Easy

Add loader.js to your header file for site-wide form support.

                  1

#### Add to header file

                    Include loader.js in your site header.

1. Open your header/layout file
2. Add the script before `</head>`
3. Replace `YOUR_DOMAIN_UUID` with your domain UUID
4. Save and upload

```
<!-- header.php or layouts/app.blade.php -->

<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title><?php echo $title; ?></title>

  <!-- MyFormConnect loader.js -->
  <script src="https://myformconnect.io/loader.js" data-client-id="YOUR_DOMAIN_UUID"></script>
</head>
<body>
```

##### Important Note

                            Use your **domain UUID** for site-wide loading.

                  2

#### Add forms without script

                    Forms no longer need individual script tags.

```
<form action="https://myformconnect.io/f/YOUR_FORM_UUID" method="POST" data-mfc="true">
  <input type="text" name="name" required>
  <input type="email" name="email" required>
  <button type="submit">Send</button>
</form>
```

##### Important Note

                            Each form still needs correct UUID in action and `data-mfc="true"`.

## ** Troubleshooting

              Check: 1) Form UUID in action URL is correct, 2) Browser console for errors, 3) You're checking the right form in MyFormConnect dashboard.

              The form is HTML only and shouldn't cause PHP errors. Check: 1) No PHP syntax errors in your template, 2) File uploaded correctly, 3) Server logs for specific error messages.

              Ensure: 1) Form has `data-mfc="true"`, 2) Script `data-client-id` is a valid UUID, 3) Script loads before form, 4) Check browser console.

              MyFormConnect forms don't need CSRF tokens since they post to MyFormConnect, not your server. Remove `@csrf` from the form if present.

#### Still having issues?

Can't find the answer you're looking for? Our support team is here to help with your integration.

          [** Contact Support](/support)

## ** Related Integrations

      [Static Sites Integration Guide →](/docs/deployment/static-sites)      [WordPress Integration Guide →](/docs/platforms/cms/wordpress)      [Drupal Integration Guide →](/docs/platforms/cms/drupal)

## ** References & Official Documentation

- ** [PHP Documentation](https://www.php.net/docs.php) **
- ** [PHP Manual](https://www.php.net/manual/) **
- ** [PHP Best Practices](https://phptherightway.com/) **
- ** [Composer Documentation](https://getcomposer.org/doc/) **

## ** Next Steps

#### ** Configure MyFormConnect

- ** Set up your timezone
- ** Configure lead notifications
- ** Set up advanced spam detection
- ** Add team members to your account

#### ** Advanced Features

- ** Use our custom form templates
- ** Try AI Insights for Leads
- ** Integrate with your CRM
- ** Set up automated workflows
