<link fails in plugin code, connecting to $_POST

I include below skeletal test code. When I solve this, I can complete the plugin.
It is a simple form, two columns in database table, only one used in the test. I cannot get the html link code to work for the code or for the css.
other functions in the plugin, such as listing the database table, work fine, It is only the connection between the form and $_POST that fails.
The init.php file is correct, i can send it if it helps, and it works for the other functions.
I am running mac mojave, local by flywheel v5.2.8
Skeletal code follows.
Dave Lyons, who is new to wordpress, and slowing down at 81.

<?php // skeletal test area. This time, connecting link with post. function fj_test() { ?>

Test string to pick up css <?php global $wpdb; echo $wpdb->prefix . "fj_instruments" . '
'; echo FJROOTDIR . 'fj_test.php' . '
'; echo WP_PLUGIN_URL . '/' . 'fj_form.css' . '
'; //$fred=$_POST[id]; //echo '

' . $fred . '

'; if (!empty($_POST['id'])){ $id=$_POST["id"]; // the other field, 'instrument', goes here echo $id; } else { echo " not bloody found"; } // sql goes here }; ?>

I must need an escape around the text, it is a mess up there!
here again

  <?php
    // skeletal test area. This time, connecting link with post.
  function fj_test() {

?>

<!--
<link type="text/css" href="<?php echo WP_PLUGIN_URL . '/' . 'fj_muso/fj_form.css' ?>" rel="stylesheet" id="fj_form"/>
<link type="test/php" href='<?php echo WP_PLUGIN_URL . "/" . "fj_muso/fj_test.php" ?>' rel="stylesheet" id="fj_form_code"/>-->

<h1>Test string to pick up css </h2>

<form action="<%php echo FJROOTDIR . 'fj_test.php' %>"  method="post" >

<p>ID: <input type="text" name="id"  /> </p>

     <p><input type='submit' name='update' value='Save!' /></p>
</form>


<?php
    global $wpdb;
    echo $wpdb->prefix . "fj_instruments" . '<br/>';
    echo FJROOTDIR . 'fj_test.php' . '<br/>';
    echo WP_PLUGIN_URL . '/' .  'fj_form.css' . '<br/>';
    //$fred=$_POST[id];
    //echo '<p>' . $fred . '</p>';
     
        if (!empty($_POST['id'])){
            $id=$_POST["id"];
            // the other field, 'instrument', goes here
            echo $id;
        } else {
            echo " not bloody found";
        }
    // sql goes here
    
   };
?>

Thank you.
Not using Elementor templates
Wordpress happily installed
No black screen problems
Don’t get a 502 error
Local works fine, no router problems.

The question is:
How do I get <form … to work?
Dave

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.