Wrox Programmer Forums
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 27th, 2014, 05:52 AM
Authorized User
 
Join Date: Jul 2010
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default check deadlines

Hi,
I'm trying to create a page for check always deadlines with this code.
I use value for verify the get in. I receive mail but max value is 7 instead should be near infinity because should get in always into db and check date.
tks


ini_set('max_execution_time', 0);
ignore_user_abort(true);
set_time_limit(0); // run script forever

$connessione = **
$value = 0;

while(true){

$timeActual = time();
$dateActual = date('Y-m-d', $timeActual);
$hourActual = date('H:i', $timeActual);

$query = mysql_query("SELECT * FROM Check_Deadlines");

while($record = mysql_fetch_assoc($query)){

$first_date = new DateTime($dateActual.' '.$hourActual);
$second_date = new DateTime($record['Data'].' '.$record['Ora']);

$difference = $first_date->diff($second_date);
$diffValue = format_interval($difference);

if($diffValue == 0){

$from = "mitt";
$to = "dest";
$subject = 'Promemoria '.$diffValue.' - '.$value;
$message = $record['Descrizione'];
$headers = "From:" . $from;
mail($to, $subject, $message, $headers);

}

}

/*ob_flush();
flush();*/
sleep(60);
$value = $value + 1;

}





Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help!! on Checkbox click how to check from database whether clicked check match. damandeep BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 March 14th, 2011 08:39 AM
How to check programmatically check the password? thomaskelly ASP.NET 1.0 and 1.1 Basics 1 May 16th, 2008 08:49 PM
Connect to VSS check-in Check-out Programatically rhd110 General .NET 6 August 12th, 2007 07:46 AM
Help 'Check ListView' vs 'Check ListBox' MikeY C# 1 February 24th, 2005 02:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.