Cooper94 Posted December 31, 2008 Share Posted December 31, 2008 I have it were when the user sign's up the date is also recorded in a database. How would I make it so that the system checks everyday or a script checks everyday if the userer has filled a "pirep" before 14 days. Say the user joins the 10th and he didnt press send on a form of some sort and it has been 14 days since he joined. How would I make it so it would email that person if he did press send on that form?*NOTE* I know I have been asking many questions over the course of the month and cant give anything back to the community. I am still new at this and I thank you so much! Quote Link to comment https://forums.phpfreaks.com/topic/139014-count-days/ Share on other sites More sharing options...
premiso Posted December 31, 2008 Share Posted December 31, 2008 You would want to use a CRON job for this and check a date/timestamp that you put in the database the day they registered and if it has been 14 days send an email. Quote Link to comment https://forums.phpfreaks.com/topic/139014-count-days/#findComment-727056 Share on other sites More sharing options...
flyhoney Posted December 31, 2008 Share Posted December 31, 2008 There are several ways to do this. You can subtract the timestamps and divide by the seconds in a day.  <?php $diff = strtotime('2008-09-23') - time(); $days = $diff / (60 * 60 * 24); ?> Quote Link to comment https://forums.phpfreaks.com/topic/139014-count-days/#findComment-727058 Share on other sites More sharing options...
Cooper94 Posted December 31, 2008 Author Share Posted December 31, 2008 Ok I have this $currenttime = time(); $newtime = $signup_date; $timedifference = $newtime - $currenttime; $temptime = floor($timedifference/86400); But this just gives me -14245. I am trying to make it subtract the signup_date to the current date of today. I think this is correct any help would be great! Quote Link to comment https://forums.phpfreaks.com/topic/139014-count-days/#findComment-727234 Share on other sites More sharing options...
Zhadus Posted December 31, 2008 Share Posted December 31, 2008 If $newtime is directly from a database, you'll need to use the strtotime() function on it. Quote Link to comment https://forums.phpfreaks.com/topic/139014-count-days/#findComment-727237 Share on other sites More sharing options...
Cooper94 Posted December 31, 2008 Author Share Posted December 31, 2008 ?? Quote Link to comment https://forums.phpfreaks.com/topic/139014-count-days/#findComment-727238 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.