|
|
Terms of Agreement:
By using this article, you agree to the following terms...
1) You may use
this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
2) You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.
3) You may link to this article from another website, but ONLY if it is not wrapped in a frame.
4) You will abide by any additional copyright restrictions which the author may have placed in the article or article's description. | put following code
<?
if ( phpversion() >="4.2.0") extract($_POST);
?>
or if you're not sure where your variables come from
<?
if ( phpversion() >= "4.2.0")
{
extract($_POST);
extract($_GET);
extract($_SERVER);
extract($_ENV);
extract($_COOKIE);
}
?>
on top of your old script
(or better put it in a file included in every page of your script)
and you're all set.
(sometimes life can be sooo easy) | |
Other 1 submission(s) by this author
|
|
|
Report Bad Submission |
|
|
Your Vote! |
See Voting Log |
|
Other User Comments |
8/5/2003 12:04:01 PM:Christian Mallette Good code, however the best way of
keeping your script compatible and
secure would be to code it the good way.
|
8/5/2003 4:39:20 PM:lixlpixel that's totally right.
and that's what
i do now, when i start to code a script
from scratch.
but there are a million
(very useful) scripts to download out
there which were coded "the old way",
and that's where this snippet jumps in
...
|
8/5/2003 5:01:04 PM:Christian Mallette agreed :)
|
8/6/2003 3:04:04 PM: If you didn't know, you can also enable
"register_globals" in your php.ini
file, which is disabled by default
since 4.2.0. I'll give this a try,
though ;)
|
8/6/2003 7:14:55 PM: register_globals is off for good
reasons, this is not the point.
as
long as you use 'old' scripts with PHP
>= 4.2.0 this script is more than
helpful.
for the future leave
register_globals off and start coding
the clean way.
|
8/11/2003 9:49:47 AM:Michael Bailey Another thing you can do if you are
using Apache is add the following line
to the httpd.conf file or create a
.htaccess file.
php_flag
register_globals on
|
12/3/2003 8:46:54 PM:Tristan Wells While this does work its a huge
security risk. When you use raw globals
PHP loads them from where ever it can
get it. So forms are easy to hack
aswell as other things.
|
12/13/2003 5:32:50 PM:UnholyAngl ini_set('register_globals',
true);
wouldn't this do the same
thing?
|
|
Add Your Feedback! |
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.
NOTICE: The author of this article has been kind enough to share it with you. If you have a criticism, please state it politely or it will be deleted.
For feedback not related to this particular article, please click here. |
|