What are the limitations of using JavaScript to verify if JavaScript is enabled in PHP web applications?

When using JavaScript to verify if JavaScript is enabled in PHP web applications, there is a limitation in that if the user has disabled JavaScript in their browser, the check will not work as intended. To overcome this limitation, you can include a server-side fallback method in PHP to verify JavaScript availability.

<?php
$js_enabled = '<script>document.write("1");</script>';
if (isset($_POST['js_check']) && $_POST['js_check'] === '1') {
    $js_enabled = true;
}
?>
<!DOCTYPE html>
<html>
<head>
    <title>JavaScript Check</title>
</head>
<body>
    <form method="post">
        <input type="hidden" name="js_check" value="1">
        <button type="submit">Check JavaScript</button>
    </form>
    <?php if ($js_enabled === true) : ?>
        <p>JavaScript is enabled.</p>
    <?php else : ?>
        <p>JavaScript is disabled.</p>
    <?php endif; ?>
</body>
</html>