If you're a LAMP user, then this vi mapping might help you out ;^)

  :imap ~P $GLOBALS['HTTP_POST_VARS']['']<Esc>hi 

...and I believe I have addressed most of your points in my previous
posting on the subject.  Forgive me if you've already read it, or if it
doesn't explain my position fully.


To address your points:
 a) Yes, please.  Add and E_NOTICE or E_WARNING if any predefined array is
assigned to.  A more radical approach would be to do away with $_GET, and
use _GET instead (a global constant.  see my post earlier today).

 b) There is a very good reason to mix the two.  We have a site/project
with at least 2000 scripts/files/directories.  Some parts are old and
stable.  They use HTTP_*_VARS.  In our newer code, we'd like to use $_GET
and friends, but there's no guarantee that we aren't depending on
changing $_GET or $HTTP_GET_VARS (for certain library functions, paging
functions, sorting functions, etc).

 c) Therein lies the problem.  I gave some thought to it and responded in
my previous message (at the URL above), but my current opinion is that
the best way to handle it is to treat all predefined variable arrays as
constants, since changing all of them is officially frowned upon. :^)

 d) Vi is you friend.  ;^)

Thanks for your response, it's interesting to hear other people's
opinions on the matter.


On Thu, 24 Jan 2002 17:45:34 -0600, Mike Eheler wrote:
> I disagree based simply on two points:
> a) Ideally, the $HTTP_POST/GET and $_POST/$_GET vars should be treated
> as "read only".
> b) There is no good reason to mix the two. Consistancy is the ideal. If
> you are working on an existing project, and you have the implied need to
> assign values to keys to request variables, then continue to use
> $HTTP_GET_VARS. There is no reason to *not* use $_GET/POST if you're
> working on a new project, and even less of a reason to MIX
> c) What would you expect to happen if you altered a request variable
> that was stuffed in $_REQUEST?
> d) $GLOBALS['HTTP_POST_VARS']['my_form_var'] is waaaaaaay too long. When
> I code, I want to complete it as quickly as I can, while maintaining
> quality. Things get too complex when I have to use 40 characters just to
> access a single variable.

PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to