• I implemented “php” code in page using [/shortcode]

    i broke down my code to a minimum.

    Issue: as soon i insert data the the field “name” and i submit the form the target page will not be found, as long the field remains empty, submitting will be successfully

    <?php
    
    ?>
    
    <form action="" method="post">
        <input type="text" name="name">
        <input type="submit" value="Formular absenden">
    </form>
    </body>
    </html>
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter fast4business

    (@fast4business)

    Trying to access array offset on value of type null in /home/dadmin/fcthalwil.com/wp-content/plugins/insert-php-code-snippet/shortcode-handler.php(99) : eval()’d code on line 35

    Hello @fast4business ,
    If you intend to process the form data using PHP, you’ll need to specify the PHP code to handle the form submission.

    Like,

    if ($_SERVER["REQUEST_METHOD"] == "POST") {
    // Check if the form has been submitted
    // Retrieve the form data
    $name = $_POST["name"];
    
    // Perform any processing you need with the submitted data
    // For example, you can echo the submitted name
    echo "Hello, $name!";
    }

    Make sure to replace the placeholder processing with your actual logic as needed for your specific use case.
    Hope this helps.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Form including PHP and HTML code doesn’t find target page’ is closed to new replies.