What I am trying to do is build a 'hatchery' for the website http://www.dragcave.net. The dragons on this website grow up by having people view and click them.
I already had it working to the point someone could input an individual dragon's code (the last 4 digits of a dragon's url) which would successfully add it to my database, but what I want to do is allow someone to put in their username, have my site automatically detect their account's eggs and hatchlings, and then choose which ones to add to my database. The website provides an API which I'm using to gather this information from.
The page I'm working on is set up as a multi-step form. The first step is plain HTML where they put in their username. The PHP then outputs the list of their eggs and hatchlings which they can check off, and the third step is supposed to be a summary of the changes made so they can see which ones are in the database and which ones aren't. This, of course, is the part I'm having trouble with.
I tried the new bit of code you provided, although it still isn't working. If I can't get this done using only PHP, then I will move on to trying it in Javascript, although I would like to avoid that if possible.
Thank you for trying to help. I only have limited knowledge of PHP, so I'm basically trying to teach myself how to do all this as I go.