SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    get into it! bigduke's Avatar
    Join Date
    May 2004
    Location
    Australia
    Posts
    847
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    db based session

    Ahem ... *cough* ... sorry about the n00b'ish tone of the post.

    Could anyone be so kind as to explain or point me to a resource as to how to do db based session handling.

    P.S. Google did not come up with helpful resources (atleast not on the first page )

  2. #2
    <? james('rules'); ?>
    Join Date
    Jun 2004
    Location
    Wales, UK
    Posts
    788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    DB based session handling? Do you mean storing the sessions in databases for use in the script?
    PHP Code:
    require_once("db_connect.php3");

    $user $_POST['username'];
    $var $_POST['var1'];

    $_SESSION['variable'] = $var

    $qu 
    "UPDATE users SET logged=1 WHERE user='$user'";

    $result mysql_query($qu)or die(mysql_error()); 
    If knowledge is power - Why isn't our army librarians?!
    Statistics show that 63% of all statistics are fake.
    When i was little i broke my neck, and i havent looked back since .
    I completed the internet in 1 week. The end boss was pretty easy though .

  3. #3
    get into it! bigduke's Avatar
    Join Date
    May 2004
    Location
    Australia
    Posts
    847
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    is that IT? that looks too darn simple ... I thought it'd be more complicated than that

  4. #4
    SitePoint Addict Adam A Flynn's Avatar
    Join Date
    Jul 2004
    Location
    Canada
    Posts
    251
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to call session_start() and such though. Read up on sessions at php.net for other info.

  5. #5
    SitePoint Enthusiast dodga's Avatar
    Join Date
    Apr 2004
    Location
    Germany
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Because that is not session handling but merely "who is logged"
    See this post for an example..
    http://www.sitepoint.com/forums/showthread.php?t=191939
    remember my name - you'll scream it later

  6. #6
    get into it! bigduke's Avatar
    Join Date
    May 2004
    Location
    Australia
    Posts
    847
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Now that makes more sense dodga. Someone needs to write a tutorial / article on that


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
  •