<?php
/**
 * soil-submit.php — DEPRECATED
 *
 * This file has been superseded by /controllers/soilTestSubmit.php
 * which uses PDO prepared statements, CSRF protection, and proper auth.
 *
 * Any form still pointing here is redirected to the correct controller.
 * Do not add logic back to this file.
 */

require_once __DIR__ . '/../../../config/database.php';
require_once __DIR__ . '/../../../lib/auth.php';

if (session_status() === PHP_SESSION_NONE) {
    session_start();
}

requireLogin();

// Redirect POST submissions to the secure controller, preserving POST data
// is not possible via header redirect — instead show an error so the
// developer knows this endpoint is stale.
http_response_code(410);
echo '<p>This form endpoint is no longer active. '
   . 'Please update the form action to <code>/controllers/soilTestSubmit.php</code>.</p>';
exit;
