Ok I think I figured out whats you're trying to do here a bit more. Here is the pseudo for how I'd do it:
That should be your basic code flow. But you still have some key syntactical problems like Deathwing said. But honestly if you're trying to learn just having us tell you exactly the syntax to use won't really teach you anything.
That should be your basic code flow. But you still have some key syntactical problems like Deathwing said. But honestly if you're trying to learn just having us tell you exactly the syntax to use won't really teach you anything.