?
Solved

Set Alarm

Posted on 2005-04-09
8
Medium Priority
?
826 Views
Last Modified: 2011-08-18
Hello,

I am trying to build a system using PHP/MySAL.
This system can send an automatic notification (email) on a specific date stored into our DB without any humain interference.
At the end my system will look like Birthday Alarm or MSN Notifications...
Send a notification to user on a specific date stored before...

What is the best way to do it?  and how?

Thank you

Dany Namroud

0
Comment
Question by:dnamroud
8 Comments
 
LVL 4

Assisted Solution

by:cachedVB
cachedVB earned 300 total points
ID: 13745904
Hi dnamroud,
This sounds like a perfect example of a Cron Job.
More info can be found at http://www.phpfreaks.com/tutorials/28/0.php

cachedVB
0
 
LVL 7

Expert Comment

by:Promethyl
ID: 13746029
Store id, enabled, alarmed, date, time, owner, desc in the database.

Query it once a day or hour, depending on your needs.

Sounds pretty simple!
0
 

Author Comment

by:dnamroud
ID: 13746755
Thank you cachedVB and Promethyl for your answers

cachedVB, your example worked only if I am running PHP/MySQL on Linux Server and i guess it's a good soultion...
What if i am using a Windows server (this is my case)


Promethyl, how can I run a query automatically on a basic schedule( once per day or per period)?

Thank you

Dany Namroud
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 7

Assisted Solution

by:Promethyl
Promethyl earned 300 total points
ID: 13746979
Oh man, you're fine. Scheduled task!

Assuming php/mysql on WIndows:

Create the program to find alarms in the database (you can also use a flat file), and email out the notices.

Dpending on the version, go to Scheduled Tasks.

Create a task for PHP. (C:\php\php.exe, be default.) Click show advanced.

Change the run line to include your program.

ITC: C:\php\php.exe -q C:\path\to\alarm.php

That should do it for you.
0
 

Author Comment

by:dnamroud
ID: 13748167
can u explain it more...

thank you

Dany
0
 
LVL 7

Accepted Solution

by:
lexlythius earned 400 total points
ID: 13748329
Go to Start > Programs > Accesories > System Tools > Task Scheduler (more or less, my WinXP is not in English).

Task Scheduler gives you the ability to start (periodically or once only) certain programs at given times very much like Unix's Cron command. Right click and add a new task (give it a name you can easily identify), then define its time schedule, then in the Run (or Execute) textbox write what Promethyl wrote:

C:\php\php.exe -q C:\path\to\alarm.php

The exact text depends on your Apache/PHP installation. If you used PHPTriad for example, it would be very much like the following:

C:\apache\php\php.exe -q C:\apache\htdocs\yourprojectfolder\alarm.php
0
 
LVL 7

Expert Comment

by:Promethyl
ID: 13748612
Precisely.
0
 

Author Comment

by:dnamroud
ID: 13753370
Thank you guys for your answer
I will split the points
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
This holiday season, we’re giving away the gift of knowledge—tech knowledge, that is. Keep reading to see what hacks, tips, and trends we have wrapped and waiting for you under the tree.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses
Course of the Month14 days, 17 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question