An IF statement cannot be found for one day. The code is as follows:
If ($ webstate! = "Y" or $ webstate! = "N") {echo "script" alert ('prompt: illegal error! Error Code: State! '); History. back (-1); script "; exit ;}
My idea is: $ is only in two cases: Y and N. If the third case occurs, an error is returned.
Now, if I only need one condition, it will be normal. if I add one OR more conditions, it will be abnormal (an error will be reported whether it is equal to Y OR N .)
Reply to discussion (solution)
My idea is: $ is only in two cases: Y and N. If the third case occurs, an error is returned.
According to your statement, the third case is that it is not Y and not N. It should be "and", not "or ".
Incorrect logical relationship with and
If ($ webstate! = "Y" | $ webstate! = "N "){
//
} Else {
//
}
If ($ webstate! = "Y" and $ webstate! = "N ")
Or
If (! ($ Webstate = "Y" or $ webstate = "N "))
My idea is: $ is only in two cases: Y and N. If the third case occurs, an error is returned.
According to your statement, the third case is that it is not Y and not N. It should be "and", not "or ".
I walked into a dead end by myself. thank you.