473,549 Members | 2,450 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"register_globa ls off" and "session side-effect"

Hi,

I set the register_global s off and try to get my code working under
the new conditions. I stuck on the following problem:

Warning: Unknown(): Your script possibly relies on a session side-
effect which existed until PHP 4.2.3. Please be advised that the
session extension does not consider global variables as a source of
data, unless register_global s is enabled. You can disable this
functionality and this warning by setting session.bug_com pat_42 or
session.bug_com pat_warn to off, respectively. in Unknown on line 0

I have no idea what they understand under the "session side-effect" as
well as "session extension" and how this "extension" can "consider"
something.

I tried to find something in the newsgroups and I found that:
http://groups.google.com/group/comp....b0666dea7d75fd

But I am not sure that I correctly understand the suggested solution
of the problem. I should replace all global variables which I care
about by "normal variables"? I.e. $varname = global-array[$varname].
Why I cannot use the global variables directly?
Jan 16 '08 #1
10 25340
Kurda Yon wrote:
Hi,

I set the register_global s off and try to get my code working under
the new conditions. I stuck on the following problem:

Warning: Unknown(): Your script possibly relies on a session side-
effect which existed until PHP 4.2.3. Please be advised that the
session extension does not consider global variables as a source of
data, unless register_global s is enabled. You can disable this
functionality and this warning by setting session.bug_com pat_42 or
session.bug_com pat_warn to off, respectively. in Unknown on line 0

I have no idea what they understand under the "session side-effect" as
well as "session extension" and how this "extension" can "consider"
something.

I tried to find something in the newsgroups and I found that:
http://groups.google.com/group/comp....b0666dea7d75fd

But I am not sure that I correctly understand the suggested solution
of the problem. I should replace all global variables which I care
about by "normal variables"? I.e. $varname = global-array[$varname].
Why I cannot use the global variables directly?
Your going to need to paste us some of the code. Kind of hard to tell
what its not liking without seeing it.

--
Daniel Ennis
faNetworks.net - Quality Web Hosting and Ventrilo Services
System Administrator / Web Developer
PHP Developer for 6 years
da****@fanetwor ks.net
Jan 16 '08 #2
Kurda Yon wrote:
But I am not sure that I correctly understand the suggested solution
of the problem. I should replace all global variables which I care
about by "normal variables"? I.e. $varname = global-array[$varname].
Why I cannot use the global variables directly?
Yes, the subject has been discussed here recently. I'll past the classic
example for you to understand quickly:

...
if( isset($admin) ) {
..
}
...

Now: http://mysite.net/myscript.php?admin=1
Here we go.

Thus, globals aren't registered automatically anymore, you have to do it
yourself: $registered_glo bal = $_SESSION['unregistered_g lobal'];

-thib´
Jan 16 '08 #3
Kurda Yon wrote:
Hi,

I set the register_global s off and try to get my code working under
the new conditions. I stuck on the following problem:

Warning: Unknown(): Your script possibly relies on a session side-
effect which existed until PHP 4.2.3. Please be advised that the
session extension does not consider global variables as a source of
data, unless register_global s is enabled. You can disable this
functionality and this warning by setting session.bug_com pat_42 or
session.bug_com pat_warn to off, respectively. in Unknown on line 0

I have no idea what they understand under the "session side-effect" as
well as "session extension" and how this "extension" can "consider"
something.

I tried to find something in the newsgroups and I found that:
http://groups.google.com/group/comp....b0666dea7d75fd

But I am not sure that I correctly understand the suggested solution
of the problem. I should replace all global variables which I care
about by "normal variables"? I.e. $varname = global-array[$varname].
Why I cannot use the global variables directly?
Are you using session_registe r() or similar functions in your code?

As Daniel said - code would help.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Jan 16 '08 #4
On Jan 15, 8:30 pm, thib´ <th...@coralsna ke-team.comwrote:
Kurda Yon wrote:
But I am not sure that I correctly understand the suggested solution
of the problem. I should replace all global variables which I care
about by "normal variables"? I.e. $varname = global-array[$varname].
Why I cannot use the global variables directly?

Yes, the subject has been discussed here recently. I'll past the classic
example for you to understand quickly:

..
if( isset($admin) ) {
..}

..

Now:http://mysite.net/myscript.php?admin=1
Here we go.
Is $admin a global variable? I thought that it can be global only
after "global $admin;"-line in the code. Am I wrong? Any variable
which is given to the php-script via the address line will
automatically become global (if register_global is "on")?

Thus, globals aren't registered automatically anymore, you have to do it
yourself: $registered_glo bal = $_SESSION['unregistered_g lobal'];
I think I have some problems with the terminology. The above example I
would describe as follow. We have assign to a "normal" variable
($registered_gl obal), a value taken from a session variable
($_SESSION). But you replace "normal" by "global" and "assignment " by
the "registrati on". Do you consider any "assignment " as the
"registrati on" or only those "assignment " is a "registrati on" in which
the value was taken from the $_SESSION?
Jan 16 '08 #5
>
Are you using session_registe r() or similar functions in your code?
Yes I use the "session_regist er()". I do not know which part of the
code should I send. It is huge and I have no idea where the problem
starts.
Jan 16 '08 #6
thib´ wrote:
Kurda Yon wrote:
>But I am not sure that I correctly understand the suggested solution
of the problem. I should replace all global variables which I care
about by "normal variables"? I.e. $varname = global-array[$varname].
Why I cannot use the global variables directly?

Yes, the subject has been discussed here recently. I'll past the classic
example for you to understand quickly:

..
if( isset($admin) ) {
..
}
..

Now: http://mysite.net/myscript.php?admin=1
Here we go.

Thus, globals aren't registered automatically anymore, you have to do it
yourself: $registered_glo bal = $_SESSION['unregistered_g lobal'];

-thib´
Yes, that's already been discussed. We've moved on. Please don't
confuse him more!

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Jan 16 '08 #7
>
..
if( isset($admin) ) {
..}

..

Now:http://mysite.net/myscript.php?admin=1
Here we go.
But even if the register_global is off the following can happen:
if( isset($_GET['admin']) ) {
...}
Now:http://mysite.net/myscript.php?admin=1

Or the ideas is that developer (programmer) will remember that $_GET
is something what is coming from the outside and will never relate the
access with the elements of $_GET?
Jan 16 '08 #8
Kurda Yon wrote:
On Jan 15, 8:30 pm, thib´ <th...@coralsna ke-team.comwrote:
>Kurda Yon wrote:
>>But I am not sure that I correctly understand the suggested solution
of the problem. I should replace all global variables which I care
about by "normal variables"? I.e. $varname = global-array[$varname].
Why I cannot use the global variables directly?
Yes, the subject has been discussed here recently. I'll past the classic
example for you to understand quickly:

..
if( isset($admin) ) {
..}

..

Now:http://mysite.net/myscript.php?admin=1
Here we go.
Is $admin a global variable? I thought that it can be global only
after "global $admin;"-line in the code. Am I wrong? Any variable
which is given to the php-script via the address line will
automatically become global (if register_global is "on")?

>Thus, globals aren't registered automatically anymore, you have to do it
yourself: $registered_glo bal = $_SESSION['unregistered_g lobal'];
I think I have some problems with the terminology. The above example I
would describe as follow. We have assign to a "normal" variable
($registered_gl obal), a value taken from a session variable
($_SESSION). But you replace "normal" by "global" and "assignment " by
the "registrati on". Do you consider any "assignment " as the
"registrati on" or only those "assignment " is a "registrati on" in which
the value was taken from the $_SESSION?
No - register_global s has nothing to do with variables you specify as
global yourself.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Jan 16 '08 #9
Kurda Yon wrote:
>Are you using session_registe r() or similar functions in your code?
Yes I use the "session_regist er()". I do not know which part of the
code should I send. It is huge and I have no idea where the problem
starts.
Start by getting rid of deprecated functions such as session_registe r.
Just use the $_SESSION array.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Jan 16 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2321
by: Larry R Harrison Jr | last post by:
I have them working now, courtesy of the link given in the prior thread--the HVMenu over at Dynamic Drive myself. http://www.dynamicdrive.com I have them working as side-bar menus, not horizontal ones on TOP of the page. I figured it out and have it working fine, except for one thing--apparently I need to insert the code for the menu...
3
1696
by: Jerry Sievers | last post by:
Hello. I have session files stored in a special tmp directory specific to a virtual host instance. The Max_lifetime is long 86400 (1 day) which I don't suppose is the problem. Anyway the sessions do indeed expire and "most" of the old session files disappear as expected. Not all however. I am finding several old session files with...
7
4181
by: Ottar | last post by:
I've made a program sorting incomming mail in public folder. The function runs every minute by using the form.timer event. In Access XP it runs for weeks, no problem. Access 2003 runs the same code for 6 hours and stops. I've found the problem to be the Set MySession = CreateObject("MAPI.Session")
6
1281
by: Steve - DND | last post by:
I'm currently creating an application with an n-tier design(not separate boxes for each layer, just separation of pres/logic/data) that will have both a web and windows interface. I'm trying to find out if there is a way to maintain user information and access it in either my business logic or data layer, without having to pass some custom...
14
5899
by: dale zhang | last post by:
Hi groups, Can anyone give me the equivalent C# sharp code for this VB.ET code, :: VB.NET :: Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles MyBase.Load 'This event routine in the loginCheck user control fires when the
5
1861
by: jensen bredal | last post by:
I need to keep track on user "session data" while still turning session off as i do not want users login to expire? Thanks JB
23
3602
by: lwoods | last post by:
I am trying to pass some info to another page on my site. I set "session_start()" in page 1, assign a session variable to a value, then execute a "header('Location: ....')." But on the target page I don't get any session variable values! BTW, I used a relative location in the Location header, not an absolute URL. The behavior looks like it...
5
1983
by: GaryDean | last post by:
Using 1.1.... I have an application using Forms Authentication that, like all other such applicaitons, uses FormsAuthentication.RedirectFromLoginPage to authenticate a user. at a point in time I want to "log off" that user meaning that I want that user to no longer be authenticated and I would also like for the Session_End event in global...
26
6258
by: drako | last post by:
Hi, I'm a bit stumped as I am getting a "Notice: Array to String Conversion" error when trying to do something that on the surface should be a very simple task - create an array, and write a set of values to them based on data submitted from POST Fields. Code below: $_SESSION = array();
2
1717
by: sheldonlg | last post by:
I did some coding on a site where register_globals is set to on. The problem I encountered was that the session variable changed without my changing it explicitly. I knew that in register globals being on, that all the variables were global variables. What I didn't realize was that it set up an equivalence such that the variable is an alias...
0
7467
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7736
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7982
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7827
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5385
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5110
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3514
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3494
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1961
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.