Actually, no. I have been trying to avoid that. I guess I should have given a bit more info... [just came from BuzzLY's 'netiquette' thread] 😉
I am trying to avoid passing the variables directly because I know I don't need to. I have been doing a very similar thing on other pages - and it works on them, but for some reason it doesn't work on this page.
Consider the following script, which is essentially set up the same way as mine:
$value = 'dumbfounded';
$didItWork = tester();
function reverser($input)
{$output = strrev($input);
return $output;}
function tester()
{global $value;
$value = reverser($value);
$feedback = 'yes, it did work';
return $feedback;}
echo 'did it work? ', $didItWork, '<br>';
echo 'value: ', $value, '<br>';
It outputs this:
did it work? yes, it did work
value: dednuofbmud
The variables are bound at the very top of the script, before the function call. The purpose of the function is its return value and its side effects. The variables are declared global in the function, altered in the function, and then called later in the script. I can't see any reason why the values I get are still the original values assigned at the top.
I have tried setting the variables inside the function (but then the variables in the form fields show up blank - as if they aren't getting out of the function).
I have tried not making a call to the clean_up() function and instead directly reassiging the variable... that didn't work (which indicated that the clean_up() function isn't the culprit.)
I have tried assigning the "cleaned-up" values to new variables, declaring them at the top of the function, and calling them in the form fields... no go.
When I enter 'my <name> is zeb', I should get this: 'my is zeb', but the values are still being displayed unaltered. 😕