otha Posted October 7, 2006 Share Posted October 7, 2006 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? Quote Link to comment Share on other sites More sharing options...
trq Posted October 7, 2006 Share Posted October 7, 2006 You need to use the $_POST global. eg;[code=php:0]$_POST['offsetf'][/code] Quote Link to comment Share on other sites More sharing options...
printf Posted October 7, 2006 Share Posted October 7, 2006 Change local names to thier SUPER GLOBAL names!Instead of....[code]$offsetf[/code]Use...[code]$_POST['offsetf'][/code]$_POST, $_GET, $_REQUEST, $_SERVER, $_FILES, $_SESSIONS, $_ENV, $_COOKIE, $GLOBALSAll have global scope!me! Quote Link to comment Share on other sites More sharing options...
otha Posted October 7, 2006 Author Share Posted October 7, 2006 Thanks folks, let me try that. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.