Re: [PHP] UNLESS Statement Equivalent

[email protected] (Angela Barone)
Newsgroups php.general
Message-ID <[email protected]>
On Mar 11, 2013, at 3:47 PM, Ashley Sheridan wrote:
> if ( !( ($current_page == $saved_page) and ($current_ip == $saved_ip) and ($current_dt < ($saved_dt + 3600)) ) )

Hello Ash,

	This makes sense to me, but I can't get it to work, so I'm either not understanding it or I'm asking the wrong question.  Here's a complete scriptlet:

<?php
$saved_page = 'ddd';
$page       = 'ddd';
$saved_ip   = '1.1.1.1';
$ip         = '1.1.1.1';
$saved_dt   = '2013-03-11 11:11:11';
$current_dt = '2013-03-11 11:22:11';

if ( !( ($current_page == $saved_page) and ($current_ip == $saved_ip) and ($current_dt < ($saved_dt + 3600)) ) ) {
	echo 'Save results.';
} else {
	echo "Don't save.";
}
?>

	Using the supplied data, the result should be "Don't save."  Can you see what's wrong?

Angela
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.