Jump to content

andresapitt

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

andresapitt's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. that's a very good point. just doing something like $dateFrom = date("d", $lastVote); $dateTo = date("d", strtotime('now')); if($dateTo==$dateFrom){ $votedToday=true; }else{ $votedToday=false; } would do the trick but, what if they trid to vote in a month time, same day different time, i just thought the was better more professional way to do it instead of doing a bunch of "ifs" Thank you anyway.
  2. I creating a vote system that allows the user to vote once each time. Does anyone have an idea how to check if he already voted today. i save in the database the time-date he voted so i need to chech everytime they are catsing a vote if he already done so today. and it should be that if he voted at 23:59 he will be able to vote again at 00:01 so far i have something very close: $lastVote=strtotime("2010-12-13 11:13:24"); $currentTime=time(); $midnight = mktime(0, 0, 0, date('n'), date('j') + 1); //time to midnight any ideas, cheers- Andrew.
×
×
  • 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.