really weird

From: Date: Tue, 08 Jan 2002 10:28:10 +0000
Subject: really weird
Groups: php.general 
Request: Send a blank email to php-general+get-79777@lists.php.net to get a copy of this message
Hello everyone my name is Chris and I have just subscribed to ask a question Currently running Redhat 7.2, php4.0.6.7, apache 1.3.22-2, mysql3.23.41-1 Now I have a script that runs every 10 mins in the crontab, that checks to see if a file size is 0 or bigger.. if it is bigger then it mails me, heres a copy #!/usr/bin/php -q <?php $check = system("cat /var/spool/mail/user_mailbox > result"); $fs = filesize(result); if ($fs > 0){ $jobfood_list = "email.txt"; $emails = file($list); for ($i=0; $i < count($emails); $i++) $emails[$i] = trim($emails[$i]); $recipient = implode(",", $emails); $mail_subject="mail notification"; $mail_body="The users mailbox has mail.\n\n"; mail($recipient, $mail_subject, $mail_body); print "mail sent"; } else { die(); } ?> Right now your in the picture this is okay to check if the mailbox is above the size of 0. But what I really need help with is, say for instance I get 1 message into the mailbox and the script runs, I only want it to run once for that message, however if another message comes in I need it to notify me... at the moment it runs every 10 mins and just keeps notifying me over & over. Any Help would be cool ...please !!! C-Ya Chris Chris Grigor ---------------------------------------------------------------------------- -------------- Client Services Call Center: 0860 100 154 Fax: +27 11 340 7345 E-Mail: Support@Bus-Sol.co.za ---------------------------------------------------------------------------- -------------- M-WEB Business Solutions Making it happen. Go shopping @ http://shopping.mweb.co.za Get your business online @ http://business.mweb.com "We all know Linux is great...it does infinite loops in 5 seconds." - Linus Torvalds

« previous php.general (#79777) next »