Php form validating help

i’m trying to make a form where the user can go to the next page by filling it my form on what and i have to choose the price of the cofee with the tax if anyone can help me out i would greatly apprecitae it this is what i got so far.

Welcome to Tim Hortons

Number of coffee's:
        <label>Size:</label>
        <select name="Size">
            <option value="-1">Select size</option>
            <option value="Small">Small</option>
            <option value="Medium">Medium</option>
            <option value="Large">Large</option>
            <option value="Extra Large">Extra Large</option>
        </select><br>
        
        <label>How many creams?</label>
        <input type="number" name="num_cream"><br>
        <label>How many sugars?</label>
        <input type="number" name="num_sugars"><br>
        <input type="submit" name="order coffee">
    </div>
    <?php
      
    ?>
</body>

also this is well

<?php $num_coffee= $_REQUEST["num_coffee"]; $Size = $_REQUEST["Size"]; $num_cream= $_REQUEST[num_cream]; $num_sugars= $_REQUEST[num_sugars]; $cost =
    ?>
         
    <label>Number of coffee</label>'
    <span><?php echo $num_coffee; ?></span>
</body>

It would be nice if you could post your entire code as I can’t see if you have placed all your form fields inside a form.

You access values from a form using super globals $_POST, $_GET or $_REQUEST (more or less a merge of the previous two).
Make sure you use $_ and not just $.

Also note that only fields with a name attribute will make it to PHP land and it’s that name attribute you should use when accessing variables. So double check the names you are trying to access: num_cream instead of numcream, size instead of Size, etc.

Its okay i finally figured it out but thanks!