Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    London
    Posts
    220
    Thanks
    0
    Thanked 0 Times in 0 Posts

    submit form authentication letter casing

    Firstly, sorry for the title. I was unsure how to word what I wanted.

    Scenario is, I have an input box with a submit button, and this is checked with a cell in the database.

    so if inputtext = databasetext then it's true, else false.

    At the moment though, this only checks text that is exactly the same and does not account for letter casing.

    so if "this answer" = "this answer" then true,
    but if "This Answer" = "this answer" it's false.

    I want to be able to have it so that the information is checked and disregards the casing, so a user can submit the forum with no caps, all caps, or a variation, and it checks the answer for the letters, numbers and such, not for the casing.

    Hope this makes sense

    Mxx
    "Imagination is more important than knowledge" A. Einstein's 'Twin Paradox'

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Use strcasecmp(). Have a look at the example at
    http://us2.php.net/manual/en/function.strcasecmp.php
    De gustibus non est disputandum.

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    London
    Posts
    220
    Thanks
    0
    Thanked 0 Times in 0 Posts
    So easy when you know how

    Thanks very much, works like a charm (or a ChArM - which although annoying typed like that, it would work too)

    Mxx
    "Imagination is more important than knowledge" A. Einstein's 'Twin Paradox'

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Sheffield, UK
    Posts
    552
    Thanks
    0
    Thanked 0 Times in 0 Posts
    if your doing it via the dateabase then just do the check in there:

    "SELECT ID FROM table WHERE field LIKE $var"

    then just check that it has returned a row.
    "To be successful in IT you don't need to know everything - just where to find it in under 30 seconds"

    (Me Me Me Me Me Me Me Me Me)

  • #5
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Readme.txt is right : compairing the two values should be done by your database. Always.

    all databases have both casesensitive (like in mySQL, the blob-types) and non-casesensitive (in mySQL, the text-columntypes) so you should use the right columntype to solve your problem.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •