RE: [PHP] PHP_SELF

From: Date: Tue, 31 Jul 2001 08:16:26 +0000
Subject: RE: [PHP] PHP_SELF
Groups: php.general 
Request: Send a blank email to php-general+get-60354@lists.php.net to get a copy of this message
> if ($post = "1" && $Age = " ") {echo "NO";} > else {echo "YES";} > Now here is what happens. On a first time view of the page it outputs > 'NO' (Good). If I dont enter anything in the age field and submit the > form it outputs 'NO' (Good). If I enter a value into the age field and > submit, it outputs 'NO' (Not Good). You are assigning these values, not comparing them $post = "1" // puts "1" in the variable $post $post == "1" // compares $post to "1" you need to change your code to if ($post == "1" && $age == " ") { blah blah blah HTH Jon

« previous php.general (#60354) next »