HTTP_*_VARS access
| From: | Andrei Zmievski | Date: | Wed, 27 Jun 2001 21:38:55 +0000 |
| Subject: | HTTP_*_VARS access | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-1023@lists.php.net to get a copy of this message | ||
Hello,
We have been discussing the idea of providing access to all the
$HTTP_*_VARS arrays provided by PHP on every request. We'd like to keep
the syntax as simple as possible, and while we have a couple of ideas on
how to do it, we are soliciting suggestions.
One way would be to create a special $request variable:
{$request.get.my_page} -- prints $HTTP_GET_VARS['my_page']
{$request.session.user_id} -- prints $HTTP_SESSION_VARS['user_id']
All in all, $request will have 6 properties for now:
$request.get
$request.post
$request.cookies
$request.session
$request.env
$request.server
Some more may be added in the future.
If we foresee creating more of these special variables in the future,
then it may be better to reserve a single variable called $php or
$smarty and have the special variables be its properties:
$php.request.get
or
$smarty.request.get
That's about it. The alternatives involve creating some sort of new
syntax and that should be avoided.
-Andrei
* DOS is, quite possibly, the worst text-adventure game ever. *