Jump to content


Photo

PHP - Username none case sensitive


  • Please log in to reply
3 replies to this topic

#1 Davey

Davey

    P2L Jedi

  • Members
  • PipPipPip
  • 620 posts
  • Location:Perth, Scotland
  • Interests:Creativity, Adrenaline, Etc

Posted 20 November 2006 - 02:03 PM

well i pmed adam asking how to make it so like IPB my username wasn't case sensitive when logging in... he helped a little but all my usernames would have to b in lowercase i think (tho i could b wrrong)

CODE

<?php

$username = strtolower($_POST['username']);

?>

strtolower, changing the string to all lowercase

i have no knowledge of php really - and have had somebody else doing it all for me so far but they aren't currently available

thnx btw adam... and anyone else who can help, it is greatly appreciated - thnx in advance


EDIT: sorry - didnt notice the php thread... if someone could move this, thanks

Edited by PSgirl: Moved :)

Edited by PSgirl, 20 November 2006 - 04:44 PM.


#2 Davey

Davey

    P2L Jedi

  • Members
  • PipPipPip
  • 620 posts
  • Location:Perth, Scotland
  • Interests:Creativity, Adrenaline, Etc

Posted 20 November 2006 - 02:44 PM

the login system he's put on me site aint using mysql

#3 Matthew.

Matthew.

    Official Spammer .Matt

  • Members
  • PipPipPipPip
  • 2,749 posts
  • Gender:Male
  • Location:England

Posted 20 November 2006 - 03:33 PM

It wouldn't have to be using mysql Davey, any type of database be it postgresql, mysql or even flatfile it wouldn't matter since the logic part of it is the same.

usename in database: Test
username submitted by form: tEsT

username from database after strtolower: test
username submitted by form after strtolower: test

So you can do a straight forward comparison.

There is also http://uk.php.net/strcasecmp i guess.

#4 Davey

Davey

    P2L Jedi

  • Members
  • PipPipPip
  • 620 posts
  • Location:Perth, Scotland
  • Interests:Creativity, Adrenaline, Etc

Posted 20 November 2006 - 04:54 PM

ahh got it... thnx to both of u... was doing something wrong...




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users