The final addition that I made to our website was the ability to click on one of the recipe titles and be taken through to a more detailed view of the chosen recipe. To do this, I had to create an id based link to the individual recipe.
<h1> <a href="selected_recipe.php?recipe_id=<?php echo ($row["recipe_id"]); ?>"> <?php echo ($row["recipe_title"]); ?> </a> </h1>
This then linked to the specific recipe page with the corresponding id via this block of code:
<?php if(isset($_GET["recipe_id"])) { $recipeID = $_GET["recipe_id"]; } else { redirectTo("index.php"); } ?> <br> <?php $result = GetSingleRecipe($recipeID); while($row = mysqli_fetch_assoc($result)) { include 'recipe_large.php'; } ?>
As you can see, the include function has changed to include ‘recipe_large.php’ rather than the standard ‘recipe.php’. This file contains more information on the recipe and it much larger in screen size.