0

In local host i could create $username and $_SESSION['username'] and were two different variables, now it seems to interfere?

3
Contributors
6
Replies
23
Views
2 Years
Discussion Span
Last Post by centenond
0

1) both are different

2) one is $username is local page variable and $_SESSION['username'] is a session variable and its an array too.

3) even $UserName, $userName, $_SESSION['uSERnAME'], $_SESSION['UserName'] all are different as php is case sensitive

4) any $_SESSION variable is available globally across all pages if you start your page with session_start(); function

5) other variables stay live for that particular page only

0

1) both are different

2) one is $username is local page variable and $_SESSION['username'] is a session variable and its an array too.

3) even $UserName, $userName, $_SESSION['uSERnAME'], $_SESSION['UserName'] all are different as php is case sensitive

4) any $_SESSION variable is available globally across all pages if you start your page with session_start(); function

5) other variables stay live for that particular page only

Yes, im aware of all this, but for some reason $username is changing $_SESSION['username'] variable... $id is changing $_SESSION['id'] value.. etc, as i said before , in localhost it was working perfectly fine... when i pass it all to ipage the problem starts..

thanks for reply

Edited by centenond

0

here are some screenshot so u know im not crazy....

1) both are different

2) one is $username is local page variable and $_SESSION['username'] is a session variable and its an array too.

3) even $UserName, $userName, $_SESSION['uSERnAME'], $_SESSION['UserName'] all are different as php is case sensitive

4) any $_SESSION variable is available globally across all pages if you start your page with session_start(); function

5) other variables stay live for that particular page only

Edited by centenond

Attachments problemwithsessions2.png 15.03 KB problemwithsessions1.png 15.58 KB
0

Is register globals turned on perhaps?

yes it is turned On, should i turn this off? (screenshot below)

Attachments on.png 2.96 KB
0

I turned to off, and now it works fine, pfff that was a weird one , thank you very much pritaes

Edited by centenond

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.