0

I need your help with php code. I usethe switch and $ _GET to jump between the substages but still show me the Undefined index: subject in line 125. Would you help me?

Here is a section of code:

    switch ($_GET['subject'])   //line 125
    {
       case "jednotky":
       include "jednotky.php";
       break;

       case "mapa":
       include "mapa.php";
       break;

       case "druh":
       include "druh.php";
       break;
Funk Forty Niner
  • 74,450
  • 15
  • 68
  • 141
  • 1
    If you are using php 7+ you can do `switch ($_GET['subject'] ?? null)`, otherwise you need to check it before the switch: `if (!isset($_GET['subject']) { //do something }` – utnaf Mar 07 '18 at 15:38
  • thanke you som much – Marek_B Mar 08 '18 at 09:41

0 Answers0