I have to agree with passing them as opposed to accessing them from inside
the function
Clean
$a = whatever;
function foo($a){
echo $a;
}
Ugly
$a = whatever;
function foo(){
global $a;
echo $a;
}
Unless the variables in question are for all intents and purposes constant (
real
Bing Du wrote:
Hello,
We use PHP 4.3.9. 'register_globals = Off' is set in php.ini. I've heard
using 'global' could cause security problems. Is using $GLOBALS still not
more secure than using the 'global' keyword? How should function foo()
obtain the value of $a?
?php
$a = 'one';
Thanks for the response.
That way is secure and has nothing to do with register_globals ;)
Good. That's what I wanted to hear. I know by default some pre-defined
global variables can be accessed through $GLOBALS. If I don't want end
users to add their own user defined variables in the
At 12:35 PM -0500 4/7/06, Bing Du wrote:
Thanks for the response.
That way is secure and has nothing to do with register_globals ;)
Good. That's what I wanted to hear. I know by default some pre-defined
global variables can be accessed through $GLOBALS. If I don't want end
users to add
4 matches
Mail list logo