Having recently started to work with PHP, I am having trouble with best practice for a page built up from multiple lookups. I think my history with other environments is getting in the way.
The main page is easy to display, the underlying table is a list of indexes to related tables. The problem is adding a new row or making modifications to that table.
What I would like to do is display a page with empty data fields but links to lookup pages. The user clicks on the link, selects the item on the lookup page, clicks the select button, and is returned to the main page with data filled in. This is fairly easy to do for the first lookup. The problem is that the user needs to make two other selections from different tables/pages. Since PHP is stateless I'm having trouble keeping the previous selections with each new selection. I have been playing with multiple post values but the code it getting very complicated (ugly) and I have just decided I have programmed myself into a box.
How would you solve such a problem?