Jump to content

Recommended Posts

I've been looking all over the place for a compare dates script that will work in my instance. I can't find one. This shouldn't be difficult, unless you're like me and get nose bleeds when trying to do anything related to numbers. I'm having a hell of a time wrapping my head around strtotime() and the epoch. Plus, I can't see straight right now :)

 

Here's what I want to do.

 

1. user joins.

2. thank you email is sent

3. if account is not activated within 3 days, send a reminder email

 

// i think it's like this
$today
$date_joined
$cutoff_date = ($today + 30 days)
if($date_joined >= ($cutoff_date - 3 days)) {
//do something
}

 

1. user joins

2. user has 30 days to try account

3. 3 days before account is to be deleted, reminder email is sent

 

// again, I'm "thinking"
$date_joined
$reminder_date = ($today + 3 days)
if($date_joined >= $reminder_date) {
do something
}

 

Thanks in advance for your understanding and help :)

Link to comment
https://forums.phpfreaks.com/topic/56654-solved-the-old-compare-dates-thing/
Share on other sites

first you going to need to check if your serve can do a cron job or equivilant then you will secondly need to setup a query that says

and then use a makedate function for $day3

$day3 = mktime(0,0,0,date("m"),date("d")-3,date("Y"));

SELECT $fields FROM $table WHERE cdate = $day3

then say

while ($row=query results)

//send email

 

 

do the same for 27 days saying d-27, but you really need cron job for it to work otherwise you need to manually run said script daily

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.