Hey all, ive made a menu where all the links post an action variable e.g /index.php?action=maths and on index.php ive got long elseif statement which checks for the correct variable and then does function accordingly however i get the following error message
Notice: Undefined variable: action in C:\Program Files\Apache Group\Apache2\htdocs\magna\test\functions.php on line 210
Notice: Undefined variable: action in C:\Program Files\Apache Group\Apache2\htdocs\magna\test\functions.php on line 214
Notice: Undefined variable: action in C:\Program Files\Apache Group\Apache2\htdocs\magna\test\functions.php on line 218
Notice: Undefined variable: action in C:\Program Files\Apache Group\Apache2\htdocs\magna\test\functions.php on line 222
Notice: Undefined variable: action in C:\Program Files\Apache Group\Apache2\htdocs\magna\test\functions.php on line 226
Notice: Undefined variable: action in C:\Program Files\Apache Group\Apache2\htdocs\magna\test\functions.php on line 230
Notice: Undefined variable: action in C:\Program Files\Apache Group\Apache2\htdocs\magna\test\functions.php on line 234
Notice: Undefined variable: action in C:\Program Files\Apache Group\Apache2\htdocs\magna\test\functions.php on line 238
Notice: Undefined variable: action in C:\Program Files\Apache Group\Apache2\htdocs\magna\test\functions.php on line 242
Notice: Undefined variable: action in C:\Program Files\Apache Group\Apache2\htdocs\magna\test\functions.php on line 246
thats where my check_action() function is
function check_action()
{
if ($action == 'maths')
{
do_maths();
}
elseif ($action == 'ict')
{
do_ict();
}
elseif ($action == 'dt')
{
do_dt();
}
elseif ($action == 'science')
{
do_science();
}
elseif ($action == 'english')
{
do_english();
}
elseif ($action == 'german')
{
do_german();
}
elseif ($action == 'spanish')
{
do_spanish();
}
elseif ($action == 'french')
{
do_spanish();
}
elseif ($action == 'drama')
{
do_drama();
}
elseif (!$action)
{
display_all();
}
}
could anyone help me please
thanks