I have finally started coding with register_global s off (crowd roars -
yeay!).
This has created a situation that I am not sure how I should handle. I
have scripts (pages) that can receive an input variable from the POST
array (initial entry) or it could be in the GET array (go back and
re-edit a form, for instance.)
In my old sloppy scripting days this was no problem, as I had
register_global s on and would merely access the the input variable by
it's local name (whether it was POST or GET made no difference).
What's the best way to handle this situation where I am not sure if the
input variable is in the GET array or the POST array? My guess is to
test for the presence of the variable (isset, != '') in either array and
then copy it to a local variable from that array.
Is that the best, only, or most efficient way to handle that?
--
*************** **************
Chuck Anderson • Boulder, CO
Integrity is obvious.
The lack of it is common.
*************** **************
yeay!).
This has created a situation that I am not sure how I should handle. I
have scripts (pages) that can receive an input variable from the POST
array (initial entry) or it could be in the GET array (go back and
re-edit a form, for instance.)
In my old sloppy scripting days this was no problem, as I had
register_global s on and would merely access the the input variable by
it's local name (whether it was POST or GET made no difference).
What's the best way to handle this situation where I am not sure if the
input variable is in the GET array or the POST array? My guess is to
test for the presence of the variable (isset, != '') in either array and
then copy it to a local variable from that array.
Is that the best, only, or most efficient way to handle that?
--
*************** **************
Chuck Anderson • Boulder, CO
Integrity is obvious.
The lack of it is common.
*************** **************
Comment