Pandora would like a page for each product choice which gives more detail, photos, nutritional information and so on:The list of links

  1. create a new page which will hold give links to the information, call it productinfo.php
  2. put a main heading Product Information
  3. inside the main PHP block under the heading create an if/else statement with condition !$_GET["product"] which will test to see if the user has clicked on a product for information
  4. in the if part show the links for them to pick a product (no PHP needed) just as you did in getsend.php:
    1. create an unordered list
    2. each list item will be one of the items in the form (cheese, chicken, ham, bacon, sandwich, roll, wrap, gluten free etc. until you have all 20)
    3. make each of those into a link with the same href (productinfo.php) for now
    4. test the page and you should see the links, click on one and the page should reload as there is no $_GET data yet
    5. add $_GET data to the link URLs in the form ?product=cheese (do not use spaces or capitals in the data e.g. Gluten free would become glutenfree
    6. test the page again and this time after you click on a link you should see nothing apart from the heading (because the else has been triggered)
  5. in the else part of the main if:
    1. use print_r (like in getget.php) to test that the product data is getting through then delete that line or comment it out
    2. put the value from $_GET into a variable called $product
    3. echo the product variable as a heading: <h1>$product</h1>

Once the page is properly working put a link to it on the products.php page.

For this practise you are done.  On a real site you would now put up information about each item but the best way to do that is to use a database.  All that matters now is that the PHP works so that if you click on a link it takes you to the same page but with different information each time.  The database comes later.

The end of PHP?

If you struggled with any of this do it again.  Think up pages and sites of your own.  Don't move on until you can quickly look up and do all of the stuff here (no one expects you to remember it all).  Programming is alien to most people so train your brain by lots of practise just like you would if you were going to speak a language, play a sport or do other challenging things in life.  Once HTML, CSS and PHP are almost automatic you will be ready for SQL.