In the following function all of the variables except $topOpen are assigned values in a form (method=post), the $offsetf is the name of a set of radio buttons, with top being one of the values. $desireda is also given a value in the form on a html document. <? function desfaceError(){ $topOpen= ($offsetf== top); if($topOpen) {$desireda = $desireda;} else {$desireda = -$desireda;} ; return $desireda; } ?> is the scope of the variables my problem, or am I asking for the wrong return value? If the scope is the problem how do I declare the variables global? or is that the right way to be heading?