从PHP / HTML表单更新SQL

Im trying to update a table with info from a form. I have one that works in a different file for table in the same database. My version just will not enter data into the table. I feel like I've edited/copied it correctly, I'm very much a noob and feel like there may be an obvious answer but i just cant see it. I've check similar questions but no luck.

<?php include "connect.php";?>

<!DOCTYPE html>
<html lang="en">


<head>
    <meta http-equiv="Content-Type" content= "text/html; charset=UTF-8"/> 
    <title>Blooming Flowers - Registration</title>
    <link rel="stylesheet" href="css/style.css" type="text/css">

</head>


<?php include "header.php"; ?>
<?php include "form.php"; ?>
<body>



        <?php include "processform.php" ; ?>

        </td>

        </tr></table>


    <?php include "footer.php"; ?>





</body>

I can narrow the problem down to either my form.php file or processform.php file but not sure why they dont work

form.php

        <td>

        <div class="form">
        <form action = "<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
            <fieldset>

                <h3>Personal Details</h3><br>

                <label>Title:

                    <select name="titles">
                        <option value="mr">Mr.</option>
                        <option value="mrs">Mrs.</option>
                        <option value="ms">Ms.</option>
                        <option value="Dr">Dr.</option>
                    </select></label>

                    <p>
                        <label for="firstName"> First Name:</label>
                        <input type="text" name="user_first" id="user_first" size="40" maxlength="60" required/>
                    </p>

                    <p>
                        <label for="lastName">Last Name:</label>
                        <input type="text" name="user_last" id="user_last" size="40" maxlength="60" required/>
                    </p>



                    <p>
                        <label for="password"> Password:</label>
                        <input type="password" name="user_pass" id="user_pass" size="40" maxlength="60" required/>
                    </p>

                    <p>
                        <label for="confirmPass"> Confirm Password:</label>
                        <input type="password" name="" id="" size="40" maxlength="60" required/>
                    </p>

            </fieldset><!--name fieldset closed-->

            <fieldset>

                <h3> Delivery Details</h3><br>

                    <p>
                        <label for="streetAddress"> Street:</label>
                        <input type="text" name="user_street" id="user_street" size="40" maxlength="60" required/>
                    </p>

                    <p>
                        <label for="city"> City:</label>
                        <input type="text" name="user_city" id="user_city" size="40" maxlength="60" required/>
                    </p>

                    <p>
                        <label for="postcode"> Postcode:</label>
                        <input type="text" name="user_post" id="user_post" size="40" maxlength="60" required/>
                    </p>

                    <p>
                        <label for="email"> E-Mail:</label>
                        <input type="email" name="user_email" id="user_email" size="40" maxlength="60" required/>
                    </p>

                    <p>
                        <label for="confirmEmail"> Confirm E-Mail:</label>
                        <input type="email" name="" id="" size="40" maxlength="60" required/>
                    </p>


            </fieldset><!-- fieldset closed-->



            <br><input class="link-button-pagemenu" name="submit" type="submit" value="Register">

        </form><!--form closed-->

    </div><!-- form div closed-->

processform.php

<?php


if (isset($_POST['submit'])){

  $user_first=      '';  
  $user_last =      '';
  $user_pass =      '';
  $user_street =    '';
  $user_city =      '';
  $user_post =      '';
  $user_email =     '';

  if (!empty($_POST['user_first'])){
  $user_first = $_POST['user_first'];
  }
  if (!empty($_POST['user_last'])){
    $user_last = $_POST['user_last'];
  }

  if (!empty($_POST['user_pass'])){
$user_pass = $_POST['user_pass'];
  }

  if (!empty($_POST['user_street'])){
   $user_street = $_POST['user_street'];
  }

   if (!empty($_POST['user_city'])){
$user_city = $_POST['user_city'];
  }

   if (!empty($_POST['post'])){
$user_post = $_POST['user_post'];
  }

   if (!empty($_POST['user_email'])){
$user_email = $_POST['user_email'];
  }

  $query = "insert into flower (user_first, user_last, user_pass, user_street, user_city, user_post, user_email) 
values('$user_first', '$user_last',     '$user_pass', '$user_street', '$user_city', '$user_post', '$user_email')";

  mysqli_query($connect, $query);
}


?>

my database table is called flower and has userID (PK), user_first, user_last, user_pass, user_street, user_city, user_post, user_email,

You are basically not posting your data to your processform.php file. Using <?php echo $_SERVER['PHP_SELF']; ?> in your action, will make the page post to itself, which mean, it's gonna be posted to your form.php file, not processform.php.

Change your form action to use the processform.php and then you should hit your query and get data into your database.

Maybe you can go here and also read a bit on global php variables:

Hope this help you :)