slj90 Posted May 4, 2014 Share Posted May 4, 2014 Hello, I am trying to store a username in session storage, however when moving to the next page the username becomes lower case. What can I do to keep the case sensitivity? Many thanks, Quote Link to comment https://forums.phpfreaks.com/topic/288237-_sessionusernameusername-not-case-sensitive/ Share on other sites More sharing options...
Solution Ch0cu3r Posted May 4, 2014 Solution Share Posted May 4, 2014 Something else is causing the username to become lowercase. PHP wont change a variables value unless you tell it to. Quote Link to comment https://forums.phpfreaks.com/topic/288237-_sessionusernameusername-not-case-sensitive/#findComment-1478176 Share on other sites More sharing options...
slj90 Posted May 4, 2014 Author Share Posted May 4, 2014 Here is the page which creates the session. session_start(); $_SESSION['username']=$username; Here is where I am trying to display it session_start(); $username = $_SESSION['username']; echo $username; I have checked the database and can confirm the username has capitals in there. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/288237-_sessionusernameusername-not-case-sensitive/#findComment-1478183 Share on other sites More sharing options...
mac_gyver Posted May 4, 2014 Share Posted May 4, 2014 you have marked this thread as solved? i'm going to guess that you actually have two rows in your database table, one as lower-case and one with the capitalization you expect. a database query will normally match any letter case, so, if you are entering your capitalized username, it can match an all lower-case row in your database table. Quote Link to comment https://forums.phpfreaks.com/topic/288237-_sessionusernameusername-not-case-sensitive/#findComment-1478190 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.