Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Help: Users can login and access their account, but not content?

  1. #11
    Join Date
    Nov 2006
    Location
    Northeast USA
    Posts
    408
    Thanks
    8
    Thanked 30 Times in 28 Posts

    Default

    So let me get this straight, If the login system is working, and the variables are being set, then The Control Panel must be the problem. Paste that code here, andd maybe the is somthing worng there.
    -Ben -- THE DYNAMIC DRIVERS
    My Links: My DD Profile||My Youtube Video Tutorials||DD Helping Coders||DD Coders In Training
    I told my client to press F5, the client pressed F, then 5, *facepalm*

  2. #12
    Join Date
    Oct 2007
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by fileserverdirect View Post
    So let me get this straight, If the login system is working, and the variables are being set, then The Control Panel must be the problem. Paste that code here, andd maybe the is somthing worng there.
    Here's what is at the top of Control Panel:

    Code:
    <?php
    session_start();
    if($_SESSION['logged'] == 1){
    include 'd/user.connect.inc.php';
    ?>
    $_SESSION['logged'] is defined when logged in, if the value is less than 1 (e.g. 0) it will redirect the user back to the sign in page.

    Here's what is at the bottom of the page:

    Code:
    <?php
    } else {
    header("Location: signin/index.phtml");
    }
    ?>
    Then that's about it really, the rest is just echoing the $_SESSION data that was set previously when the user logged in.

    I hope this helps, if you need anymore of my script to work out this problem then just ask .

    I'm currently doing a few adjustments to the code, to see if that will fix this problem but still no luck yet.

  3. #13
    Join Date
    Nov 2006
    Location
    Northeast USA
    Posts
    408
    Thanks
    8
    Thanked 30 Times in 28 Posts

    Default

    You have WAY too may "logged in" variables:
    if(isset($_SESSION['uid'])){ and
    if($_SESSION['logged'] == 1){ and
    if($_SESSION["s_username"]){

    they all check the same thing, whether the user is logged in.
    Stick with 1 variable, the "logged" one, and change these (blue)
    Code:
    <?php
    session_start();
    if(!$_SESSION['logged'] == 1){
    include 'd/user.connect.inc.php';
    ?>
    html stuff
    ---
    <p><b>Notice:</b> You are already logged in as <b><?php echo $_SESSION['s_username']; ?></b>... Please go to your <a href="http://users.domain.com/cp.php">Control Panel</a></p> 
    ---
    More html stuff (if logged in)
    <?php  
    } else { 
    
    echo 'Not Logged in...'; 
    ?>
    More stuff to show if not logged in
    <?php
    } 
    ?> 
    other html ending  html stuff (both)
    and change this (on the login page):
    Code:
    if($row['activated'] > 0) //checks to see if the user is activated or not. 
    { 
    
    $_SESSION['logged'] = '1';
    Hope this helps!
    -Ben -- THE DYNAMIC DRIVERS
    My Links: My DD Profile||My Youtube Video Tutorials||DD Helping Coders||DD Coders In Training
    I told my client to press F5, the client pressed F, then 5, *facepalm*

Bookmarks

Posting Permissions

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