By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,361 Members | 2,177 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,361 IT Pros & Developers. It's quick & easy.

crazy script prints variable value from other scripts?

P: n/a
I have spent two hours trying to make sense of this script, called
crazy.php. The output should be nothing because $cookie_password is
nowhere defined in this script, correct? But it actually outputs the
value that other scripts i have running set it to. Why should crazy.php
care what other scripts are running that use that variable name??
<?php

crazy();

////////////////////////////

function crazy() {

global $cookie_password;

echo $cookie_password;

} // end function

?>

Oct 3 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
sq****@peoriadesignweb.com wrote:
I have spent two hours trying to make sense of this script, called
crazy.php. The output should be nothing because $cookie_password is
nowhere defined in this script, correct? But it actually outputs the
value that other scripts i have running set it to. Why should crazy.php
care what other scripts are running that use that variable name??
<?php

crazy();

////////////////////////////

function crazy() {

global $cookie_password;

echo $cookie_password;

} // end function

?>
Are you including this script in another one?

Do you have register_globals set to on?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Oct 3 '06 #2

P: n/a
Jerry Stuckle wrote:
Are you including this script in another one?
nope, the script is just being run alone. it is not included from
anywhere
Do you have register_globals set to on?
i am on a shared host and did a phpinfo and got this:

register_globals On On

so that must be it!

Oct 3 '06 #3

P: n/a
sq****@peoriadesignweb.com wrote:
Jerry Stuckle wrote:
>>Are you including this script in another one?


nope, the script is just being run alone. it is not included from
anywhere

>>Do you have register_globals set to on?


i am on a shared host and did a phpinfo and got this:

register_globals On On

so that must be it!
Get another host. I wouldn't trust any host who runs with it on.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Oct 3 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.