Chasing paper in the dark here.. Please post your code for the session problem, and the error message you are getting. Otherwise we cannot see what is going wrong.
Just one little thing: You need to place session_start(); at the top of every page that uses the session; session_start() does not actually start a session that stays alive in memory for as long as you would want. It looks for an existing session uses it if it exists, or starts a new one if not. So you need to call it every time, to recall the information set on previous pages.
What you had there would work:
// If in the url the variable username is set to the exact word userpage:
if($_GET['username'] == 'userpage';
{
// Do what ever you would like here
}
Mind you: Naturally you would want to only create a link to a page for which a user needs a login when they are logged in. However, that does not mean that someone who is not logged in cannot get that link (e.g., by bookmarking the page when logged in). So make sure you perform a test whether the user is logged in on the page as well. If not: Show a login form. You could use this, by providing the links as a teaser: If you are not a user, you can register, else: login.
[/code]