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.
Page 3 of 3 FirstFirst 123
Results 31 to 33 of 33
  1. #31
    Regular Coder
    Join Date
    Nov 2011
    Posts
    250
    Thanks
    8
    Thanked 4 Times in 4 Posts
    Do I need to start the session first as this will also be on pages that don't require people to log in?

  2. #32
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,281
    Thanks
    57
    Thanked 523 Times in 510 Posts
    Blog Entries
    5
    Quote Originally Posted by tangoforce View Post
    In *ANY* script that uses sessions, you MUST call session_start().
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  3. #33
    Regular Coder
    Join Date
    Nov 2011
    Posts
    250
    Thanks
    8
    Thanked 4 Times in 4 Posts
    Thought I'd seen that on here somewhere. Done it but it still shows the link even if not logged in.

    This is the code for my link.
    PHP Code:
    <?php
    if ((isset($_SESSION['username'])) and ($_SESSION['username'] != ''))
       {
       echo 
    "<li><a href='../members.php' rel='ddsubmenu3'>My Account</a></li>";
    }
    ?>


 
Page 3 of 3 FirstFirst 123

Posting Permissions

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