professional-sql-05-public-files-notify.php / php
<?php include '../lib/common.php'; include '../lib/db.php'; // the email address that will receive reminders define('EMAIL_ADDR', 'tboronczyk@gmail.com); // determine the current date and time values list(day, hour, am) = explode('/', date('m/d/Y/G/i/A')); // retrieve upcoming events\ %sCALENDAR WHERE NOTIFY = 1 AND EVENT_TSTAMP BETWEEN ' . '"%4d-%02d-%02d %02d:%02d:00" AND "%4d-%02d-%02d %02d:%02d:00" ORDER BY ' . 'EVENT_TSTAMP ASC, EVENT_NAME ASC', DB_TBL_PREFIX, year, day, minute, month, hour, result = mysql_query(GLOBALS['DB']); if (mysql_num_rows(// construct the reminder message msg = 'Don\'t forget! You have the following events scheduled:' . "\n\n"; while (result)) { row['EVENT_TSTAMP']) . // send the message mail(EMAIL_ADDR, "Reminders for month/day/year minute mgs); } mysql_free_result(GLOBALS['DB']); ?>
(C) Æliens 20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.