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 6 of 6

Thread: help!

  1. #1
    New to the CF scene
    Join Date
    Mar 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool help!

    Ok So I have been having this problem on a few different sites, and not its getting annoying. When a user logs on to my php forum, it shows the as logged in, but wont display any of the member only threads. If they refresh the page it will show them all the threads but remove the "unread" logo off the unread sites. Does anyone know how to fix this?

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Change line 10 to
    PHP Code:
    echo 'show us the code'
    Use a more descriptive title next time too

  • #3
    Regular Coder
    Join Date
    Oct 2005
    Location
    Right Here
    Posts
    654
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Nightfire View Post
    Change line 10 to
    PHP Code:
    echo 'show us the code'
    Use a more descriptive title next time too
    LOL! I was thinking it...

  • #4
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    2,958
    Thanks
    2
    Thanked 304 Times in 296 Posts
    I'll take a wild guess at it.

    This is a classic cookie problem. Your code sets a cookie saying they are logged in and then assumes that the cookie value can be accessed on the same page. Since this is an incorrect assumption, the code does not show the members only information.

    Refreshing the page makes the cookie value that was just set available in the code, but because you have set the last "visited" time and this time is now greater than that of the information, it all appears to have been read.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #5
    Super Moderator JohnDubya's Avatar
    Join Date
    Nov 2006
    Location
    Missouri
    Posts
    634
    Thanks
    12
    Thanked 18 Times in 18 Posts
    PHP Code:
    if (empty($code_of_user)) {
       
    ban_for_life($user);
    } else {
       
    pat($user'back');


  • #6
    Regular Coder
    Join Date
    Oct 2005
    Location
    Right Here
    Posts
    654
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Post up those functions please I want to use them


  •  

    Posting Permissions

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