Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts

    Sessions problem

    I'm having problems with sessions. How can you carry the session from page to page?

    I've got this at the top of the login page:

    session_start();
    session_register('username');

    and then on the page where the member can edit their info, I've got:

    if(session_is_registered("username")=='') {
    echo error;
    } else {
    page here
    }

    What am I doing wrong? It's always showing the "error", even after logging in.

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Oops, nevermind. I just noticed what I've done wrong.

  • #3
    Regular Coder
    Join Date
    May 2002
    Location
    London, England
    Posts
    369
    Thanks
    0
    Thanked 0 Times in 0 Posts
    care to share?
    Jeewhizz - MySQL Moderator
    http://www.sitehq.co.uk
    PHP and MySQL Hosting

  • #4
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts
    forgot to add

    session_start();

    to the top of the edit page


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •