Google
 
Webnews.only-4-geeks.com
Interesting places
news.only-4-geeks.com Forum Index » PHP

Setting $_SESSION when not used?

 
Jump to:  
 
jodleren
PostPosted: 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
PostPosted: 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
PostPosted: 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
PostPosted: 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
PostPosted: 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
 

Page 1 of 1 .:.

Google
 
Webnews.only-4-geeks.com

Windows Update | C++ | C | PHP | JavaScript | Photoshop | Programming | Windows 2000 | Python | Windows XP | Object | Flash | Flash - ActionScript | Paint Shop Pro | Excel | PowerPoint | Access | Word | Windows 98 | Internet Explorer 6.0 | CorelDraw12 | Java | XML | asm x86 | Linux Mandrake | Linux RedHat | Outlook |  | news from newsgroups |_ | s

Web Templates

Awesome Website Templates ©

Czarny chleb - Dżem grecja Dzwonki i Tapety biuro rachunkwe poznan Motywy K500