I’ve got what I think is a simple problem but I’m having a tough time working out what the best strategy is and I hoping you could help.
I’m using CodeIgniter to build my new website (currently in dev), where users are able to create, edit and delete campaigns. And each campaign has a sub-campaign which the can also edit, delete and create each sub-campaign.
Whilst in the add campaign view, how do I (in pseudo code) mark the form (or session in a way where the sub campaign the user is creating gets assigned to the correct campaign. My thoughts at the moment are to either
(1) Use the id of the campaign within the url and pull the correct segment. For example http://www.website.com/campaign/12345/add-sub-campaign
or
(2) Inside the form element put the name of the campaign in a hidden input field, and grab that through the post and use that to link the new sub-campaign to the campaign.
Thanks for your help with this tedious question! I’d prefer just to do it the right way first time.