Calling sessions

Discussion in 'PHP' started by wvccboy, Oct 24, 2007.

  1. #1
    Ok I have this code here:
    
    
      /**
       * The session variable ($_SESSION[$sessionVariable]) which will hold the data while the user is logged on
       * var string
       */
      var $sessionVariable = 'userSessionValue';
    
    Code (markup):
    It gets started, bla bla bla, I know that works because I can post to the DB without a problem.

    The problem I'm having now is, I want the post to post under the user logged in user ID.

    At the top of the post page I have:

    require_once 'access.class.php';
    $user = new flexibleAccess();
    if ($user->is_loaded())

    I need this field to be a hidden field in the field below.

    Thanks
     
    wvccboy, Oct 24, 2007 IP
  2. tonybogs

    tonybogs Peon

    Messages:
    462
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Apologies but im having trouble understanding your problem???

    Please provide a little more info :)
     
    tonybogs, Oct 25, 2007 IP
  3. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #3
    ^^ I'm completely lost too.

    Neither "Bla bla", nor "post to post under the user logged in user ID", nor "hidden field in the field below" makes sense to me.
     
    nico_swd, Oct 25, 2007 IP
  4. wvccboy

    wvccboy Notable Member

    Messages:
    2,632
    Likes Received:
    81
    Best Answers:
    1
    Trophy Points:
    250
    #4
    Ok sorry about that..

    I'm trying to create a script that posts to the MySQL database.

    The user logs in using the "login" script. It creates a cookie and sessions for the user.

    I have that sessions posted at the top of each PHP page so that it checks whether the user is logged in, and as what username the user is logged in as.

    I'm trying to create a form that posts to the database, but posts the LOGGED IN user to the database.

    I'm unable to find a way to read the logged in user and then post that ID to the database along with the post.

    The sessions code is above.

    Thanks
     
    wvccboy, Oct 25, 2007 IP