SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard dragonfly_7456's Avatar
    Join Date
    Dec 2002
    Location
    Moscow, USSR
    Posts
    1,092
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Working with special chars

    What I'm doing is making sure that a user can login with ANY type of username, not matter what characters it contains.

    How do I make sure that any special chars submitted through a form get formatted, so that they don't mess up any php coding in the processing script, but then still be able to find out what the original user name WAS ... so that I could run it through a database check with a password match... ?

    For example.... I've got a few *strange* usernames in my database such as
    person^
    per.son
    per@son
    per$son
    p.e.r.s.o.n.
    per son

    Yes, people like to get creative with their names... And the situation is that its too late to change the registration part of the database (and make sure no special chars like that are allowed).

    Worse yet, I've already implemented a couple of scripts installed in my site to use this *global* user table.

    Now I've got a new script, and it's working with plain old person but it keeps breaking when I use special chars...

    Any ideas?

    EDIT: The *new* script is not mine. It's actually a bug reporting script called FlySpray. Now my goal was to merge it's user database with my forum's database. That was a success, but this little bug is messing up my bug reporting script.

    I've got a feeling that the script is making sure that the user field in the form doesn't contain any special chars. When ever I try to use a username with a special char, even if it doesn't exist in my database, I get a white page with the following text: name request is invalid.

    But I've searched every part of the script inside and out and there isn't even a hint of such a class or if statement that is giving out that message.

    ... Which makes me wonder... Is there some kind of php function that is designed specifically for doing exactly this? I'm not very familiar with php's built in functions, and there is a good chance that that message is being created by some rare php function.... I don't know. I'm pretty much clueless.

    Have a go at loggin in with a "special" username right here: http://www.duckvillage.net/bugs/

    Thanks for any help!
    Content Writing Service - Get custom SEO articles for 10$

  2. #2
    SitePoint Wizard Lats's Avatar
    Join Date
    Jun 2003
    Location
    Melbourne, AU
    Posts
    1,142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try a search in the source for that error message 'name request is invalid', it's most likely linked to the function rejecting the name.
    Lats...

  3. #3
    SitePoint Wizard dragonfly_7456's Avatar
    Join Date
    Dec 2002
    Location
    Moscow, USSR
    Posts
    1,092
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm still wondering how I had missed that one file... Fixed. Thanks.
    Content Writing Service - Get custom SEO articles for 10$


Bookmarks

Posting Permissions

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