How can you ensure that the character limit is enforced even if JavaScript is disabled?

To ensure that the character limit is enforced even if JavaScript is disabled, you can perform server-side validation using PHP. This means that the input data is validated on the server before processing it further. By implementing server-side validation, you can prevent users from submitting data that exceeds the character limit even if JavaScript is disabled.

<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
    $input = $_POST["input_field"];
    
    // Check if input exceeds character limit
    if (strlen($input) > 100) {
        echo "Character limit exceeded";
    } else {
        // Process the input data
    }
}
?>