关闭register_globals? [英] turn register_globals off?
本文介绍了关闭register_globals?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我刚接过网站上班。我还在学习PHP。
Register_globals打开并且脚本似乎被编码以获得
的优势。我知道如何重新编写脚本,但我不确定
如何在完成后关闭它们。我用谷歌搜索了一下
在.htaccess文件中放置
php_flag register_globals
。 br />
我这样做没有重新编码脚本,脚本仍然有用,所以
我假设我没有关闭它们。请帮忙。
谢谢,
彼得
解决方案
运行phpinfo()以查看register_globals的设置。
//脚本显示phpinfo的内容()
<?php
print(phpinfo());
?>
是的,我这样做了,它们都开启了。当我试图在
..htaccess中关闭它们时,它们仍显示为ON。
谢谢,
彼得
嗯,这就是我的.htaccess的样子(如果你是$ b $,将4改为5) b有php5)
< IfModule mod_php4.c>
php_value register_globals 0
< / IfModule>
>
I just took over the website at work. I am still learning PHP.
Register_globals are on and the script appears to be coded to take
advantage of this. I know how to recode the script, but am unsure how
to turn them off when I am done. I have googled and came up with
placing
php_flag register_globals off
in the .htaccess file.
I did this without recoding the script and the script still worked, so
I am assuming I did not turn them off. Please help.
Thanks,
Peter
解决方案
Run phpinfo() to see the settings for register_globals.
// script to display contents of phpinfo()
<?php
print(phpinfo());
?>
Yes, I did that and they are ON. When I try to turn them off in
..htaccess, they still show as being ON.
Thanks,
Peter
Well, this is what my .htaccess looks like (change the 4 to a 5, if you
have php5 )
<IfModule mod_php4.c>
php_value register_globals 0
</IfModule>
这篇关于关闭register_globals?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文