I think sessions would be the best answer to your problem like Eclipse said

,
All you need to do is place a
at the very top fo your page before any data is sent out to your browser or you'll get some nasty errors then just register your variable.
Registering the Session:
and now wherever there is a page with sessions started you can use "$_SESSION['variable']" all over your page ^_^