I manage to find the project which is similar with my project and it is provided with the following code with using the program WinCron:
The shell script used to run mail.php script every minute; used by WinCron program:
{
#this is the main script
-name "email script"
#start now and repeat every one minute
-start -inc 0 0 1 0
#load and run the mail script
-command -shell [url]http://amns/amns/mail.php[/url]
}
and there is the PHP script used to query database and send out mail notifications every minute, this is what is executed by the above WinCron script in the attachment (mail.txt), Below is only part of them:
<?
include_once("./include/include.php");
$database = "AMNS";
$message = "There is new mail in your post office box.";
$lkid = connect();
$query = "SELECT * FROM contact WHERE has_mail=1 and been_notified=0";
$info = send_sql($database, $query);
what i want to ask is about the command: include_once("./include/include.php");
is it possible that the part of the php script include is
<?php
$hostname='localhost'; //// specify host, i.e. 'localhost'
$user='root'; //// specify username
$pass='password'; //// specify password
$dbase='testdb'; //// specify database name
$connection = mysql_connect($hostname , $user , $pass)
or die ("Can't connect to MySQL".mysql_error());
$db = mysql_select_db($dbase , $connection) or die ("Can't select database.".mysql_error());
?>
as linking to database is not shown in mail.txt,
another is the command: $database = "AMNS";
i don't understand here is the "AMNS" represents what? Because as i read and try to understand the mail.txt, my understanding of this command is the $database should be the linking connection, as later AMNS as the sender of the email so i get more and more confuse....
$lkid = connect(); ---- why it is not using mysql_connect ()
if ($email_pref == 1)
{
mail($email, "New Mail Has Arrived", $message,
"From: AMNS\r\n"
. "X-Mailer: PHP/" . phpversion());
echo "E-mail Sent to $email successfully!<BR>";
}
Refer to commands above, "From: AMNS\r\n"
. "X-Mailer: PHP/" . phpversion() is the header field, right but i don't understand about this part: . "X-Mailer: PHP/" . phpversion()
Do anyone know how to use wincron, is it easy to use?
Hopefully, someone can clear my doubts.....
Thanks!!!