hello
I'm trying to loop through the checkboxes in a form from within a function. When I explicity request a certain value, it works. but then a few lines later I try to loop through, it is not finding anything. any ideas?
Thanks!
Here's the code
function admin_edit_event_html(){
GLOBAL $html, $config, $HTTP_GET_VARS, $HTTP_POST_VARS, $conn;
//////////// irrelevant code removed
if ($HTTP_POST_VARS["actiontype"] == "update_event"){
// these work, they get the values from the form
$m_event->set_event($HTTP_POST_VARS["event_name"]);
$m_event->set_date($HTTP_POST_VARS["event_bc"] . $HTTP_POST_VARS["event_date"]);
$m_event->set_overview($HTTP_POST_VARS["event_overview"]);
$m_event->clear_timeline_id();
// Here is where it's not finding anything
while (list($key, $val) = each($HTTP_POST_VARS)){
if(substr($key, 0, 11) == "tl_checkbox"){
$m_id = str_replace("tl_checkbox_", "", $key);
if(is_numeric($m_id)){
$m_event->set_timeline_id($m_id);
}
}
}
}
//////////// irrelevant code removed
}