Really this is quite a general question, n Id appriciate links to sources of info as well as answers if ya know nethin. at the moment im workin on a site where people log in, and then the code does all sorts of things based on the username dragged out of their username cookie. now thats all very well n good, but ive recently noticed that my logins are case insensitive. Ie- if someone logs in as eternity instead of Eternity, it sets the cookie eternity with a small e. The major problem with this of course is that on other occasions php IS case sensitive. so when I tell it to create a folder named $Username on the ftp, and then go back logged in as the same $username but with a small u, it doesnt recognise the folder exists, n all sorts of problems come about.

Is there an easy answer to this? A easy way to ensure that php is either Always or Never case sensitive? Ideas?

    use [man]strtolower[/man] or [man]strtoupper[/man] to make sure the to strings your comparing are the same case...

      hmm. thats not precisely what I want to do though, because if I undertstand those correctly all they do is change the string to upper or lower case. Thatd mean that my users couldnt have capitalised names would it not? How do you all get around this problem? Ive never seen a profiling site that doesnt allow capitalised names before so there must be a quick fix for this somewhere.

        Store the information as is, when pulled from the database, use the previously mentioned functions to compare 2 strings. If you want to display the name of someone then you leave as is and don't use the functions.

        <?
         echo $row['name'];
        if(strtolower($row['name']) == $name)
        {
           // SOME CODE HERE
        }
        else
        {
          // SOME CODE HERE
        }
        ?>
          Write a Reply...