When using an if expression, dual equals must be used. If you only use one (as in $gender = M ) then what will happen is that PHP will assign M to that variable. Thus, it will always return true in addition to changing the variable.
Additionally, all strings must be encapsulated by quotes. For...