There's no need to really do what you did with that function just do it like this:
PHP Code:
if($action == 'addyourstuff')
{
doformheader("tacemon","modifying");
maketableheader("Modifying TAC?mon:");
makeinputcode("Old Name:","old_name",$old_name);
makeinputcode("New Name:","new_name",$new_name);
makeinputcode("New Variable:","new_var",$new_var);
makeinputcode("New Data:","new_data",$new_data);
doformfooter("Submit Modifications");
}
if($HTTP_POST_VARS['modifying'])
{
// insert your queries and error checking here n stuff
}