if ($authorgender = "male") {
Needs to be
if ($authorgender == "male") {
== is a comparison operator http://www.php.net/manual/en/language.operators.comparison.php
= assigns the value to the variable http://www.php.net/manual/en/language.variables.basics.php