Forums

Mutil Login Per Account Prevent (6 posts)

  1. sarethan
    Member
    Posted 1 year ago #

    So this page http://www.webmasterworld.com/php/3055206.htm states that there is a fix for the multi login per account by pasteing this

    #Prevent Membership Fraud
    //check if someone is logged in
    if (isset($_SESSION['user_id'])) {
    //connect to your db
    require('../../../connect.php');
    /*build query using hirer_id and current_session_id, get count. If query comes back with a 1, it means there is a match. A match is good because it means no one else logged in during their session. On the other hand, a 0 indicates that no match, meaning someone else logged in simultaneously. Zeros get the boot of death.*/
    $result = mysql_query('SELECT COUNT(*) FROM user WHERE user_id='.$_SESSION['user_id']." AND session_id='".mysql_real_escape_string(md5(session_id()))."'");
    $login_status = mysql_result($result,0,0);
    //recall 1 is good, 0 is bad
    if (0 == $login_status) {
    //give them the boot
    //this is copied from my logout script
    $_SESSION = array(); //destroy the variables
    session_destroy(); //destroy the session itself
    setcookie(session_name(), '', time()-300, '/', '', 0); //destroy the cookie
    echo 'Hey, someone else logged in using your account info which means you get the boot.';
    exit();
    }
    }

    In the header. All i get is the header showing the txt no matter where i place it in the header.

  2. Rev. Voodoo
    Volunteer Moderator
    Posted 1 year ago #

    it needs to be inside php tags.

    so either put inside ones you already have, or add them.

    <?php
    all that code
    ?>
  3. sarethan
    Member
    Posted 1 year ago #

    ooo thank you i will try that

  4. sarethan
    Member
    Posted 1 year ago #

    that seems to have hide it but it still allows 1 account to login on sevral pc at the same time.

  5. sarethan
    Member
    Posted 1 year ago #

    anyone got help on this?

  6. sarethan
    Member
    Posted 1 year ago #

    BUMP

Topic Closed

This topic has been closed to new replies.

About this Topic