PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > alt.comp.lang.php > Email reminders?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Email reminders?

Réponse
 
LinkBack Outils de la discussion
Vieux 01/08/2007, 17h38   #1
Dave Mennenoh
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Email reminders?

Is there a way with PHP to send out a timed, email reminder? For instance,
to send a client an email that their subscription will be expiring in a
week - or to send an email a day before an appointment is due. I can see how
to do if someone logs in and then I run a appointment checker script - but
how to do as a service, or daemon, so it works anytime?

--
Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/


  Réponse avec citation
Vieux 01/08/2007, 21h53   #2
John Murtari
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Email reminders?

"Dave Mennenoh" <dave@blurredistinction.com> writes:

> Is there a way with PHP to send out a timed, email reminder? For instance,
> to send a client an email that their subscription will be expiring in a
> week - or to send an email a day before an appointment is due. I can see how
> to do if someone logs in and then I run a appointment checker script - but
> how to do as a service, or daemon, so it works anytime?


Normally on Unix/Linux you would use a 'cron' job and
schedule it to run daily/hourly/etc.... WHen it is activated
you can have it check for reminders or whatever. You can use
PHP in the script.
Hope this s.

--
John
__________________________________________________ _________________
John Murtari Software Workshop Inc.
jmurtari@following domain 315.635-1968(x-211) "TheBook.Com" (TM)
http://thebook.com/
  Réponse avec citation
Vieux 02/08/2007, 12h40   #3
C.
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Email reminders?

On 1 Aug, 17:38, "Dave Mennenoh" <d...@blurredistinction.com> (Head
Developer AND Adobe Community Expert) wrote:
> Is there a way with PHP to send out a timed, email reminder? For instance,
> to send a client an email that their subscription will be expiring in a
> week - or to send an email a day before an appointment is due. I can see how
> to do if someone logs in and then I run a appointment checker script - but
> how to do as a service, or daemon, so it works anytime?
>


Like the other guys said, cron is the prefered way to do this. And you
should implement it is as CLI PHP parsed script outside the webserver
document root.

If this is not possible becuase you've got a really cheap hosting
service you could tie it to your web requests in a common include:

<?php

if (rand(80)>75) { // tune according to your traffic levels/required
granularity
if (filemtime($path_to_touch_file) && !file_exists($lockfile)) {
file_put_contents($lockfile, getmypid());
$qry="SELECT * FROM scheduled_jobs WHERE due<=NOW()";
// (of course you don't need to store the jobs in a database)
....
$qry="UPDATE scheduled_jobs SET due=due+repeat_interval WHERE id=
$job_id";
....
unlink($lockfile);
file_put_contents($path_to_touch, getmypid());
}
}

?>

HTH

C.

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 22h09.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,08830 seconds with 11 queries