function make_login_form($u = '', $p = '', $r = '', $u_error = '', $p_error = '' , $r_error = '') { $options = ['1'=>'Author', '2'=>'Editor', '3'=>'Admin']; echo '
'; } function make_radio_group($name, $options, $selected_value) { $output = 'User '.$u.' is logged in with role = '.$r.'
'; } else { $u_error = ''; if ($u == '') { $u_error = 'Must enter username'; } $p_error = ''; if ($p == '') { $p_error = 'Must enter password'; } $r_error = ''; if ($r == '') { $r_error = 'Must enter role'; } make_login_form($u, $p, $r, $u_error, $p_error, $r_error); } } else { make_login_form(); } ?>