Once you retrieved your categories, let’s say in $categories
, you can do something like this:
<?php
foreach ($categories as $catgory) {
?>
<form id="cat-button-form-<?php echo $category->ID; ?>" action="<?php echo $url_to_step_2; ?>" method="POST">
<input type="hidden" name="mycat" value="<?php echo $category->ID; ?>" />
<input type="submit" name="getcat" id="getcat_<?php echo $category->ID; ?>" class="btn_catstep" value="<?php printf(__('Select %s & Continue'), $category->name); ?>" />
</form>
<?php
}
?>
In step 2 you then read $_POST['mycat']
and go from there.