Results 1 to 4 of 4

Thread: server date

  1. #1
    Join Date
    Jan 2007
    Posts
    58
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default server date

    Hi, im new here, nice forum!

    i got a problem... What about if you want to run a script every monday, everytime a user log in, like a monday's surprice

    if (date("D") == 'Mon') {
    RUN SCRIPT; }
    else { NOTHING }

    the problem is, with this method the user could change their computer date and get the surprice any day at any time, just need to change their computer date to monday. How can i do to instead of check for the user's time, to check the time of the server where the website is hosted?

    Thanks!

  2. #2
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    PHP is a server side script, it is already running off of server local time, unless you set an off set or have in your script to check visitors local time, you shouldn't have to worry about that issue.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #3
    Join Date
    Jan 2007
    Posts
    58
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default

    hehhe, i was about to say i found it myself ^^ thanks anyway for your reply the date uses the time (hours/minutes/seconds) of the guest but the date (month/day/year) of the server. Problem fixed, thanks!.

  4. #4
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    YAY! Glad it's working for you
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

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
  •