|
Posted by Chuck Anderson on 01/20/06 07:28
Pedro Graca wrote:
>Chuck Anderson wrote:
>
>
>>I have finally started coding with register_globals off (crowd roars -
>>yeay!).
>>
>>
>
>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.)
>>
>>
>
>Why is it not POST again?
>
>
I'm not definitely sure. I scripted these pages a couple of years ago. I
think it was to provide a look and feel for the user interface I
preferred. A form button to get there to start with and then for some
reason a regular link seemed more appropriate for getting back to the
page. I probably also reused the page/script, but without a form.
>>Is that the best, only, or most efficient way to handle that?
>>
>>
>
>As Kimmo said you can use the $_REQUEST array which is contains
>(almost (*)) all the $_GETs and $_POSTs.
>
>(*) The $_REQUEST array will *not* have duplicate keys from $_GET,
>$_POST, and $_COOKIE. There's a configuration value that specifies what
>order is followed when PHP builds the $_REQUEST array (default is GPC,
>meaning GET, POST, COOKIE).
>
>If you have
> $_GET['id'] = 4;
> $_POST['id'] = 14;
> $_COOKIE['id'] = 77;
>
>$_REQUEST['id'] will be 77.
>
>I never needed to use $_REQUEST and I always know whether the user input
>comes from $_GET, $_POST, or $_COOKIE.
>
>
Thanks for that extra bit of info. The correct location will be either
POST or GET. They will never both be used.
--
*****************************
Chuck Anderson • Boulder, CO
http://www.CycleTourist.com
Integrity is obvious.
The lack of it is common.
*****************************
Navigation:
[Reply to this message]
|