I am moving to a new server and the app that worked fine on the old server with global_register = ON worked fine. Now, that it is OFF some of my functionality does not work properly.
On the old server I had a part that the code would detect if certain var is set:
if (isset($VAR)) {
...
}
I understand that I can now do it like:
if (isset($_GET['VAR'])) {
...
}
But this is where I have my dilemma. Is $VAR is set I output a list. Each line is a link and when it is clicked it displays more details asssociated with that line. So I am submitting via $GET here. Also, next to each line there is a checkbox, and when at least one is checked I need to click a button that outputs details of all selected items. The submit is done here via $POST.
So I was thinking that I could put something like that at the beginning where I check if $VAR is set:
if ($_POST['VAR']) {
$VAR = $_POST['VAR'];
} else {
$VAR = $_GET['VAR'];
}
But besides being kind of awkward it also messes up my code (I think) since on POST my VAR is an array.
So, how do I go about checking if the VAR isset and at the same time avoiding that GET/POST mess? It was so much easier with global_register being ON... I guess if I could use something like isset without tieing it to the submit method I'd be fine....