1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Simple PHP Timeclock with multiple users, and Clock In/Clock Out times recorded?

Discussion in 'PHP' started by bigraymeehan, Nov 19, 2011.

  1. #1
    I haven't coded anything in awhile, and I wasn't awesome with php before, but i'm hoping to create a simple page for a store that will have links to all of the sites commonly used for it, and hopefully a simple timeclock too, instead of purchasing or finding a decent free timeclock they can just access the website to do it.I'm not asking for a script, unless you're willing to throw one together for me. I'm really just looking for the right direction on how to do it using sessions? I think would be best. Sorry, i'm extremely rusty haha, once I get started it will come back though.I just want say "Jeff" to be able to come into work, go to the website, and put in a username/password (password not actually needed) and then "clock in", and then the script will keep a record of the time until he "clocks out" and will then have an option to view hours by day, and totals by week, or maybe a date selection (maybe a date selection is too complicated to start with).Anyways, any tips are appreciated, and I'll be googling, and youtubing and such to try and move on on my own. Thanks in advance!
    SEMrush
     
    bigraymeehan, Nov 19, 2011 IP
    SEMrush
  2. kids

    kids Active Member

    Messages:
    411
    Likes Received:
    4
    Best Answers:
    2
    Trophy Points:
    68
    #2
    I don't understand all your description. But it's can be:

    - Member "Jeff" log in to you system at 1:00 and out at 2:00, and your system will record time in/out of one member. It's right?

    It's very simple with cookie and session coding. You can make it more flexible with MySQL to record by function time().
    - User login -> if success -> record time in, write cookie/session status of member is "online" -> redirect to homepage
    - User logout -> record time logout, delete cookie/session -> redirect to homepage.

    Hope this is the way that you need.
     
    kids, Nov 20, 2011 IP
  3. bigraymeehan

    bigraymeehan Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    yes, sorry it was confusing, I haven't actually coded in so long i'm not even sure of the right words to explain what I want to do. You pretty much have it perfectly. I could just set it to record into a mysql database, and then to collect the daily/weekly data.. I could set just post the data from the DB right? What functions record the session time?
     
    bigraymeehan, Nov 20, 2011 IP
  4. bigraymeehan

    bigraymeehan Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Okay, sorry for the double post. I have more to elaborate on the last post. To record the time I could record sesson_start as a variable, and session_end as a variable.. take the difference and upload that to a database as the hours of the day right?
     
    bigraymeehan, Nov 20, 2011 IP