I have been laboring over this seemingly rediculous issue for far too long:
values passed to the php page are automagically assigned to a variable as page.php?action=one should result in $action being available in the page. For me the following snippet of code will not work. The print of $action prints the variable correctly, once go() is called $action is no longer assigned? Could any one please offer some insight into whether this is a scoping issue, if so the correct usage, if not suggestions? Happy New Year!
<?php
echo $action;
function go() {
switch($action) {
case "one" :
print "action was one";
break;
case "two" :
print "action was two";
break;
default :
//ends up being NULL
print gettype($action);
}
}
go();
?>
-JP