TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 09-13-2009, 01:25 PM   #1 (permalink)
The Contributor
 
russellharrower's Avatar
 
Join Date: Jul 2009
Posts: 80
Thanks: 13
russellharrower is on a distinguished road
Default PHP Timer

Hi I need away to do the following

Say I have a song that is 3:00 <-Minutes
and it was placed in the DB at 12:45
and the time is now 2:50
I need it to tell me if the song has finished or how many minutes/seconds are left.

If any one can help that would be so kind.
russellharrower is offline  
Reply With Quote
Old 09-13-2009, 03:02 PM   #2 (permalink)
The Addict
 
Join Date: May 2009
Posts: 287
Thanks: 5
adamdecaf is on a distinguished road
Default

Store the start time in a cookie or a database (and give the user an ID to match against). Then just compare the time.
__________________
My Site
adamdecaf is offline  
Reply With Quote
Old 09-13-2009, 03:04 PM   #3 (permalink)
The Contributor
 
russellharrower's Avatar
 
Join Date: Jul 2009
Posts: 80
Thanks: 13
russellharrower is on a distinguished road
Default

Sadly that will not work, Due to it is all in the database, and as we are allow users to search and find Now playing information from radio stations that would mean a lot of cookies I think.

Thoughts?
russellharrower is offline  
Reply With Quote
Old 09-13-2009, 06:24 PM   #4 (permalink)
The Acquainted
 
Randy's Avatar
 
Join Date: May 2007
Location: Your G/F's Closet
Posts: 114
Thanks: 7
Randy is on a distinguished road
Default

create a section on the database called 'users' or something like that then do something like this.

take the users ip store it in the database with the time. then have like an end time accessed at some point. then to find how many minutes are left do like "$end - $start" and store data in your database via IP
__________________
Real Programmers always confuse Christmas and Halloween because Oct31 == Dec25 - Andrew Rutherford
Send a message via AIM to Randy Send a message via MSN to Randy
Randy is offline  
Reply With Quote
The Following User Says Thank You to Randy For This Useful Post:
russellharrower (09-14-2009)
Old 09-14-2009, 03:57 PM   #5 (permalink)
The Contributor
 
russellharrower's Avatar
 
Join Date: Jul 2009
Posts: 80
Thanks: 13
russellharrower is on a distinguished road
Default

Thank you.
russellharrower is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't get PHP 5. to work? Newbie windows PHP guy DotNetTim Absolute Beginners 11 02-01-2013 11:02 AM
10 PHP Myths Dispelled Wildhoney General 9 06-15-2009 06:55 AM
Next class project? allworknoplay The Lounge 6 04-18-2009 08:33 PM
PHP Compressor Kalle Script Giveaway 8 05-28-2008 12:14 AM
what are all the subjects in php? sarmenhb General 7 01-21-2008 05:41 PM


All times are GMT. The time now is 08:24 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design