Let me just explain you my problem. I am working on a php form template which could be useful for more events in our company. In this form I collect few things about our employees but that is out of question.
My problem is that in form I have HTML SELECT element, where are some OPTIONs inside. I have this option in PHP array, for better imagination for example termins for Blood donation. I need to handle that only one employee can sign in for specific termin.
Can I somehow limit "the usage of array element"? I mean, when someone has already signed in for termin X, just don't allow another employee to pick this termin.
Thanks.
<-- EDIT -->
here is the code:
This is my config.php (the file, where all variables are configured
$termins = array(
'8:00' => '',
'8:30' => '',
'9:00' => '',
'9:30' => '',
'10:00' => '',
'10:30' => '',
'11:00' => ''
);
and here is index.php where I fill the options into select element
<?php
foreach($termins as $key => $value) {
echo '<option value="myvalue">' . $key . ' </option>';
}
?>
I think that "Disable" is the way how to solve this. When the option is already picked, i just have to change the OPTION to "Disabled". But this comes to my second question: How to change the property of html OPTION element to Disabled and keep this change? Should I use php sessions?