Here's the long and short:
I'm looking to add a global controller for post meta tags in Wordpress. I already have an established Wordpress custom admin page within our theme. I also already have added meta boxes to individual pages which store key value pairs in a more polished fashion. I have been able to call all key value pairs in a foreach loop so that they display in the administrative page. I'm having difficulty getting the input from these values on the admin panel page to properly update when the submit_button(); is clicked. I've gotten the update_post_meta function to outright erase the previous values but I have not been able to get the update_post_meta function to properly pass the $_POST value into the value at the database.
I know that the following code is not working as it's halfway through two attempts. Any help is appreciated:
$pages = get_pages();
foreach ( $pages as $page ) {
$post_id = $page->ID;
$meta = get_post_meta($post_id);
/* $value1 = get_post_meta( $post_id, 'value1', true );
$value2 = get_post_meta( $post_id, 'value2', true ); */
echo '<h3>' . $page->post_title . '</h3>';
echo '<label for="options_value1_' . $post_id . '">Value 1:</label>';
echo '<input type="text" id="options_value1_' . $post_id . '" name="options_value1" value="' . $meta['value1'][0] . '" size="25" /><br />';
echo '<label for="options_value2_' . $post_id . '">Value 2:</label>';
echo '<input type="text" id="options_value2_' . $post_id . '" name="options_value2" value="' . $meta['value2'][0] . '" size="25" /><hr />';
}
foreach ( $pages as $page ) {
update_post_meta($post_id, 'value1', $_POST('value1');
update_post_meta($post_id, 'value2', $_POST('value2');
}