variables, unless re-posted, are lost after the page they're posted to. There's two ways around this:
Use sessions. Check the many tutorials and articles about them on this site.
Use an input tag. <input type="hidden" name="varname" value="value_to_pass">. While this method might be ok for just three pages, it'll start to get labourious after three or four pages.
In short, if you're only going for three pages, the input method is probably easier, but if you're going for more, use sessions.