473,413 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,413 software developers and data experts.

crazy script prints variable value from other scripts?

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
3 1749
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Øystein Johansen | last post by:
Hi, (This question may be stupid, but I just can't find the answer...) How can I make the browser downlaod a cgi script from /cgi-bin/. Obviously I can't make a link to it with...
11
by: doltharz | last post by:
Please Help me i'm doing something i though was to be REALLY EASY but it drives me crazy The complete code is at the end of the email (i mean newsgroup article), i always use Option...
1
by: Tim Pascoe | last post by:
I've been trying to get the scripts posted earlier to the group by Clay Beatty to work properly. Using the three components he posted, I have managed to get a new SP generated. However, when I...
0
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs...
17
by: CES | last post by:
All, I was wondering if their is a way of loading an external script fill from within a script?? <script language="javascript" type="text/javascript"> function test(var){ <script...
1
by: drec | last post by:
I need to pass a variable from script1.php to script2.php. The problem is that these scripts use frames and therefore I am able to pass the variable through the URL. It also does not use forms to...
8
tolkienarda
by: tolkienarda | last post by:
hi all i have a login script that is simplified with out any extra stuff. and it doesn't seem to work. i think the problem is something to do with session variables. but i am not sure what it is....
2
by: lazukars | last post by:
I have been going over the this code for hours and am baffled. Am I missing something stupid? I am creating dynamic html via innerHTML for a webpage. There is an onClick function in this...
1
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.