you need an AND not an OR && you have if one condition is true do this thing
since they both can not be != at the same time then you have TRUE or FALSE = TRUE FALSE or TRUE = TRUE only if they are both false will it be FALSE and not be done, make some truth tables son http://www.google.com/search?q=logic%20truth%20tables Sam D On 1/29/07, Mountain Man <[EMAIL PROTECTED]> wrote: > > Hello, > > I did a search for "conditional statements" and "conditional > statement" on Cake PHP and received 3 listings, none of which answers > the following question. Thanks in advance to all who can help. > > I have a problem with a conditional statement and hope someone can > offer some insight on it. The code with comments is shown below. I > only want this code to be executed if the value of $own_files[0] is > something other than "Yes" or "No." Unfortunately the code is executed > when the array element holds these values. > > <?php > 1 elseif(($own_files[0] != 'Yes') || ($own_files[0] != 'No')){ > 2 $state_array['own_files'] = 'false'; > 3 echo "From the function: $own_files[0]<br />"; > 4 // When the value of $own_files[0] on line 3 reads 'Yes' or 'No' > this conditional > 5 // code is executed. Do you see a problem with my conditional > statement? > 6 } > ?> > > Cheers, > > Mountain Man > > > > > -- == S. DeVore (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a real question and an idiot --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
