|  | Setting $_SESSION when not used? |  | |
| | | jodleren |  |
| Posted: Tue Sep 02, 2008 5:04 pm Post subject: Setting $_SESSION when not used? |  |
Hi!
// get user to edit if( ($_POST["reply"]=="btn_selusr")||($_POST["btn_selusr"]!="") ) { echo "x:".$_SESSION['username']; $username=stripslashes($_POST["userlist"]); echo "y:".$_SESSION['username']; }
on line "x" it is correct, while line "y" I have the session var changed too???? $username is a local var for the user being edited, while $_session... is the user logged (in this case some kind of admin)
Why the h... does the variable affect the session var?
My system has been transferred from an unknown server to an apache server - PHP version was 5.2.6, now it is 5.2.0 - that should not do anything? I also have the other problem mentioned below, that the $_SESSION stays even when the browser is closed.
WBR Sonnich |
| |
| | | Michael Fesser |  |
| Posted: Tue Sep 02, 2008 5:04 pm Post subject: Re: Setting $_SESSION when not used? |  |
..oO(jodleren)
| Quote: | // get user to edit if( ($_POST["reply"]=="btn_selusr")||($_POST["btn_selusr"]!="") ) { echo "x:".$_SESSION['username']; $username=stripslashes($_POST["userlist"]); echo "y:".$_SESSION['username']; }
on line "x" it is correct, while line "y" I have the session var changed too???? $username is a local var for the user being edited, while $_session... is the user logged (in this case some kind of admin)
Why the h... does the variable affect the session var?
|
register_globals is enabled on that machine - it should be turned off in the php.ini.
Micha |
| |
| | | jodleren |  |
| Posted: Thu Sep 04, 2008 9:50 am Post subject: Re: Setting $_SESSION when not used? |  |
On Sep 2, 9:33 pm, Michael Fesser <neti...@gmx.de> wrote:
| Quote: | .oO(jodleren)
// get user to edit if( ($_POST["reply"]=="btn_selusr")||($_POST["btn_selusr"]!="") ) { echo "x:".$_SESSION['username']; $username=stripslashes($_POST["userlist"]); echo "y:".$_SESSION['username']; }
on line "x" it is correct, while line "y" I have the session var changed too???? $username is a local var for the user being edited, while $_session... is the user logged (in this case some kind of admin)
Why the h... does the variable affect the session var?
register_globals is enabled on that machine - it should be turned off in the php.ini.
|
That has no effect at all. The problem remains... |
| |
| | | Jerry Stuckle |  |
| Posted: Thu Sep 04, 2008 10:09 am Post subject: Re: Setting $_SESSION when not used? |  |
| |  | |
jodleren wrote:
| Quote: | On Sep 2, 9:33 pm, Michael Fesser <neti...@gmx.de> wrote: .oO(jodleren)
// get user to edit if( ($_POST["reply"]=="btn_selusr")||($_POST["btn_selusr"]!="") ) { echo "x:".$_SESSION['username']; $username=stripslashes($_POST["userlist"]); echo "y:".$_SESSION['username']; } on line "x" it is correct, while line "y" I have the session var changed too???? $username is a local var for the user being edited, while $_session... is the user logged (in this case some kind of admin) Why the h... does the variable affect the session var? register_globals is enabled on that machine - it should be turned off in the php.ini.
That has no effect at all. The problem remains...
|
That is your problem. It looks like you might be changing the wrong php.ini file - or you're not stopping/restarting the web server after making changes.
-- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
| |
| | | Michael Fesser |  |
| Posted: Thu Sep 04, 2008 4:16 pm Post subject: Re: Setting $_SESSION when not used? |  |
..oO(jodleren)
| Quote: | On Sep 2, 9:33 pm, Michael Fesser <neti...@gmx.de> wrote: .oO(jodleren)
// get user to edit if( ($_POST["reply"]=="btn_selusr")||($_POST["btn_selusr"]!="") ) { echo "x:".$_SESSION['username']; $username=stripslashes($_POST["userlist"]); echo "y:".$_SESSION['username']; }
on line "x" it is correct, while line "y" I have the session var changed too???? $username is a local var for the user being edited, while $_session... is the user logged (in this case some kind of admin)
Why the h... does the variable affect the session var?
register_globals is enabled on that machine - it should be turned off in the php.ini.
That has no effect at all. The problem remains...
|
Check phpinfo() or ini_get() to see that it is really turned off. $_SESSION['username'] and $username are completely different and independent variables, they only interfere if register_globals is on.
Micha |
| |
|
|