Jump to content

heckenschutze

Members
  • Posts

    257
  • Joined

  • Last visited

    Never

Posts posted by heckenschutze

  1. Don't do that, what if the user used a proxy server? Or several proxy servers? Some ISPs even use proxy servers, so your user would be pretty pissed off if you told them their account had been 'hacked' when they try to log in.

     

    Just chuck an extra field in your user table, 'lastAction' or something. Which stores a timestamp of their last action, if someone else tries to login in a time say greater than 'lastAction' + timeout then let them (and destroy the original session), else don't.

  2. I'd suggest starting again for the date/time, you seem to be making it hard on yourself.

     

    A unix timestamp the the no. of seconds after 1970.

    $ourTime = time();
    $gameTime = array(  'year' => date('Y', $ourTime) + 2404,
                        'month' => date('m', $ourTime),
                        'day' => date('d', $ourTime));
    
    echo 'Game year is ' . $gameTime['year'];
    

    Set it out something like that, you can change $ourTime to the start time, and just factor in how far in days, seconds, years or whatever the game time is ahead. No need to keep going back and forth.

  3. Remember that a UNIX timestamp only has precision until 2038, http://en.wikipedia.org/wiki/Year_2038_problem

     

    The number of the year, may be a two or four digit value, with values between 0-69 mapping to 2000-2069 and 70-100 to 1970-2000. On systems where time_t is a 32bit signed integer, as most common today, the valid range for year is somewhere between 1901 and 2038. However, before PHP 5.1.0 this range was limited from 1970 to 2038 on some systems (e.g. Windows).

     

    But you're not using a timestamp to store the year, so most likely your clock is wrong.

  4. Your script will stop if config.php can't be included if you use require(), for any reason. Ie it doesn't exist or PHP doesn't have privs to read the file.

     

    include() will issue a warning if config.php cannot be included, but will continue running the script.

     

    Use require() for vital files, and include() for other non-vital things.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.