I have a meal type page (breakfast.php) that a user can select a breakfast package. Once the package selection is confirmed I would like to display that selection in the homepage.php. If I use a input = 'text' and grab the form data it works great but for some reason it will not select the content of my h4 element. Is there a way to grab the selection even if there is say 4 or 5 packages?
This is my code:
breakfast.php
<form action="homePage.php" method="post">
<div class= "breakfast">
<u><h2>The Share Collection</h2></u>
</br>
<img src= "\images\Breakfast\breakfast1.jpg" class="funky">
</br>
</br>
<dl>
<dd>Mini jar of housemade granola: vanilla yoghurt, fresh fruit (v) (6)</dd>
<dd>Goat cheese, cherry tomato & basil, mushroom tart (v) (8)</dd>
<dd>Mini slider jamon serrano, fig jam, rocket, brie & black pepper (8)</dd>
<dd>Chef's mini sweet muffin (v) (8)</dd>
<dd>Bowl of strawberries & grapes (v) (1)</dd>
</dl>
</br>
<input type='button' value='Select This Package' id='button3' onclick="changemyButton()">
<hr>
<section>
<h1 id="logo">Total Ordered</h1></section>
<hr>
</br>
<h4 id ="selection" name="foodchoice"> </h4>
<br>
<br>
<br>
<br>
<input type="submit" id="button4" value="Submit Your Selection" name="submit">
</center>
</form>
homepage.php
<p> You have selected <?php echo $_POST["foodchoice"];?><br> as your order!
I am new to php and would like the best way to perform this. Thanks.