Sorry, I could not find a suitable name for this question. I created the following using a for loop, and I linked the names of the submit buttons using the template below: submit_edit_category_1 submit_edit_category_2 submit_edit_category_3
echo "<input type='submit' value = 'Edit' name='submit_edit_category_" . $obj_categories_admin->categories[$i]['category_id'] . "'/>";
I want to skip these values so that I can use the action of the button whichis edit_category and the category identifier, which is 1.2 or 3. I want something like:
if(isset($_POST) == 'edit_category')) {
Someone suggested I do this as follows:
name="submit[which_action][which_category]" a1 = $_POST['submit']; $which_action = reset(array_keys($a1)); $which_category = reset(array_keys($a1[$which_action]));
This does not work. Can someone give me another way to do this? Thanks!
php mysql
chupinette
source share