473,320 Members | 1,839 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,320 software developers and data experts.

register_global = on, mix between $_SESSION and local variables

Hi,
I'm coding Php under register_global = off flag, but, most (all ?) of php
hosting companies use the "on" flag with their shared servers...
I spent too much time to finally discover that my sessions went mad because
the $_SESSION['pseudo'] was updated by a simple $pseudo = $row['pseudo']
(from the DB)...
It's ok when, on my local conf, i use it with the register_global = off, but
once uploaded online, on a shared server with register_global = on, sessions
goes mad... I use the built-in php session mechanism and the file where
information session is saved is updated in a wrong way because of this
mix...

Is there another way for me than avoid using same names with my $_SESSION
stuff and other local variables ?

Thanks a lot,
Arnaud
Jul 17 '05 #1
4 3328
Undercat wrote:
Hi,
I'm coding Php under register_global = off flag, but, most (all ?) of php
hosting companies use the "on" flag with their shared servers...
I spent too much time to finally discover that my sessions went mad because
the $_SESSION['pseudo'] was updated by a simple $pseudo = $row['pseudo']
(from the DB)...
It's ok when, on my local conf, i use it with the register_global = off, but
once uploaded online, on a shared server with register_global = on, sessions
goes mad... I use the built-in php session mechanism and the file where
information session is saved is updated in a wrong way because of this
mix...

Is there another way for me than avoid using same names with my $_SESSION
stuff and other local variables ?

Thanks a lot,
Arnaud

You know you can use a .htaccess on your hosting platform to have Global
off just in the folder you want ? Some self-made security...

Something like...

<IfModule mod_php4.c>
php_flag register_globals off
</IfModule>

Aphrael
--
"La demande mondiale d’ordinateurs n’excédera pas cinq machines."
(Thomas Watson, Fondateur d'IBM, 1945)
Jul 17 '05 #2
Aphrael, being the foo Aphrael is, wrote:
Undercat wrote:
Hi,
I'm coding Php under register_global = off flag, but, most (all ?)
of php hosting companies use the "on" flag with their shared
servers...
I spent too much time to finally discover that my sessions went mad
because the $_SESSION['pseudo'] was updated by a simple $pseudo =
$row['pseudo'] (from the DB)...
It's ok when, on my local conf, i use it with the register_global =
off, but once uploaded online, on a shared server with
register_global = on, sessions goes mad... I use the built-in php
session mechanism and the file where information session is saved is
updated in a wrong way because of this mix...

Is there another way for me than avoid using same names with my
$_SESSION stuff and other local variables ?

Thanks a lot,
Arnaud

You know you can use a .htaccess on your hosting platform to have
Global off just in the folder you want ? Some self-made security...

Something like...

<IfModule mod_php4.c>
php_flag register_globals off
</IfModule>

Aphrael


Would that work for the entire website? Say I wanted to have
register_globals off as well but my host doesn't have it.

--
Sharif T. Karim
....you don't know wrath yet...
Jul 17 '05 #3
"Sharif T. Karim" <sh****@nyc.rr.com> emerged reluctantly from the
curtain and staggered drunkenly up to the mic. In a cracked and
slurred voice he muttered:
Aphrael, being the foo Aphrael is, wrote:
Undercat wrote:
Hi,
I'm coding Php under register_global = off flag, but, most
(all ?) of php hosting companies use the "on" flag with their
shared servers...
I spent too much time to finally discover that my sessions
went mad because the $_SESSION['pseudo'] was updated by a
simple $pseudo = $row['pseudo'] (from the DB)...
It's ok when, on my local conf, i use it with the
register_global = off, but once uploaded online, on a shared
server with register_global = on, sessions goes mad... I use
the built-in php session mechanism and the file where
information session is saved is updated in a wrong way because
of this mix...

Is there another way for me than avoid using same names with
my $_SESSION stuff and other local variables ?

Thanks a lot,
Arnaud

You know you can use a .htaccess on your hosting platform to
have Global off just in the folder you want ? Some self-made
security...

Something like...

<IfModule mod_php4.c>
php_flag register_globals off
</IfModule>

Aphrael


Would that work for the entire website? Say I wanted to have
register_globals off as well but my host doesn't have it.


..htaccess rules cascade to all sub-directories.

--
Phil Roberts | Without me its just aweso. | http://www.flatnet.net/

"Mankind differs from the animals only by a little,
and most people throw that away."
- Confucious
Jul 17 '05 #4
"Aphrael" <Aphrael@_ANTISPAMisuisse_com> a écrit dans le message de
news:40**********@news.bluewin.ch...
You know you can use a .htaccess on your hosting platform to have Global
off just in the folder you want ? Some self-made security...
Something like...
<IfModule mod_php4.c>
php_flag register_globals off
</IfModule>


Hi,
Yes, good idea, i'll try !

Thanks,
arnaud.
Jul 17 '05 #5

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

Similar topics

2
by: Pedro Fonseca | last post by:
Greetings everyone! I'm porting everything to PHP5. I have session variables in all of my web application. Until PHP5 I was using session variables like: if ($_SESSION == 'Bar') { $value = 5;...
15
by: mammothman42 | last post by:
hi i've got a basic user register form, action="POST". in my php code (on the same page, i store the $_POST stuff to a $_SESSION if the user screws a field up so they don't have to reenter all...
13
by: Mimi | last post by:
Hello, I am having trouble using the session vars in PHP 4.3.9 OS: Win XP Prof Web Server IIS (is local and there are no links to other servers from the web pages I work on) Browser: IE 6.0 ...
4
by: Tom | last post by:
A small problem that has me kinda baffled. This is the situation: I've set up a self-submitting form FORM.PHP. Once the inputs are validated, the info gets put in SESSION variables and the...
2
by: Tom | last post by:
I put together a code that checks for 2 post variables then stores them in a multi-dim $_SESSION array, something like this: If ( isset($_POST && isset($_POST) ) { $_SESSION = $_POST;...
4
by: comp.lang.php | last post by:
This is an urgent request (as always) generate_admin_customer_position_dropdown($customerResult, $customerResult->id); print_r($_SESSION); This code will generate an HTML dropdown as...
4
by: Daz | last post by:
Hi everyone. I'm just wondering if it's considered bad practice to have a class read from and write to the $_SESSION super global. I was just learning a little about object serialization, and I've...
4
by: jodleren | last post by:
Hi! // get user to edit if( ($_POST=="btn_selusr")||($_POST!="") ) { echo "x:".$_SESSION; $username=stripslashes($_POST); echo "y:".$_SESSION; }
4
TheServant
by: TheServant | last post by:
Hi guys, This is my situation. I have 3 sets of data used on every page of my website. Two of these never change, and the reason they are stored in MySQL and recalled into the $_SESSION variable is...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.