Jump to content

ryooichi

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ryooichi's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I was just reading my php.ini for the 43rd time today and comparing it to the one on the other machine and you are right. On the machine having problems, register_globals was on. I tested it both ways and this was the culprit. Thank you for the quick response and pointing me in the right direction.
  2. I have a PHP application doing MySQL-based sessions on 2 different Windows 2003 Server machines running Apache2 (Win32) and one has PHP 5.0.5 and the other 5.1.2. On both, in php.ini, magic_quotes_gpc is set to off. On the machine running PHP 5.0.5, everything is working fine. But using PHP 5.1.2, I seem to be having an issue where setting a regular scalar variable whose name happens to match a key in the $_SESSION variable, is referring to the same thing. This reminded me to check what magic_quotes_gpc was set to and confirmed that it was in fact set to off. For example, I have a session variable stored in $_SESSION['username'] and can correctly print out its value before I set an assumingly separate variable, $username to '' (an empty string). Afterwards, when I print out the value of $_SESSION['username'] it now reflects '' (an empty string). I.E.: [code]$_SESSION['username'] = 'ryooichi'; print "\$_SESSION['username'] = \"{$_SESSION['username']}\"<br>\n"; # prints: $_SESSION['username'] = "ryooichi" $username = ''; print "\$_SESSION['username'] = \"{$_SESSION['username']}\"<br>\n"; # prints: $_SESSION['username'] = ""[/code] So my question is: what is going on here? Of course, my current workaround is simply to not use $username as the name for my other variable and have changed it to just $user and the conflict has now ceased. I would just like to understand it and hopefully learn how can I control this behavior. Thank you.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.