Jump to content

variable scope


otha

Recommended Posts

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?
Link to comment
https://forums.phpfreaks.com/topic/23232-variable-scope/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.