This topic is locked
[SOLVED]

 Username field in uppercase

2/17/2007 6:29:05 AM
PHPRunner General questions
G
gdude66 author

All of my users have their usernames in uppercase but they are used to entering them in lowercase (because they are lazy).
How and where can I edit the project so that if they enter their username in lowercase it will convert it to uppercase prior to authentication? <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=4645&image=1&table=forumtopics' class='bbc_emoticon' alt=';)' />

D
Dale 2/17/2007

Graeme,
Using ver 3.0.

I uppercase a little deeper into the app, then on just the registration page.

I use is for my Canadian Postal Codes formating eg. V1W 1X1

With the two modifications I save and display the data in uppercase, and when the user types uppercase is displayed in the form.
You may simply want to add the style example on the registration page template.
I added the styles below into my style.css, then when the user types it in the Uppercase happens right on the form also.

then I just edit the registration template to add the class=upper on the username input.
.upper { font-size: 10pt; text-transform: uppercase;}

postal { font-size: 10pt; text-transform: uppercase;}
In the Before Add and the Before Save events use the example below.

//** Custom code ****

// put your custom code here

$values["postal_zip_code"]=strtoupper($values["postal_zip_code"]);

return true;
That's how I acomplished the task. Ver 3.1 is a bit different, the folks may have an easier answer for you.

G
gdude66 author 2/17/2007

Graeme,

Using ver 3.0.

I uppercase a little deeper into the app, then on just the registration page.

I use is for my Canadian Postal Codes formating eg. V1W 1X1

With the two modifications I save and display the data in uppercase, and when the user types uppercase is displayed in the form.
You may simply want to add the style example on the registration page template.
I added the styles below into my style.css, then when the user types it in the Uppercase happens right on the form also.

then I just edit the registration template to add the class=upper on the username input.
.upper { font-size: 10pt; text-transform: uppercase;}

postal { font-size: 10pt; text-transform: uppercase;}
In the Before Add and the Before Save events use the example below.

//** Custom code ****

// put your custom code here

$values["postal_zip_code"]=strtoupper($values["postal_zip_code"]);

return true;
That's how I acomplished the task. Ver 3.1 is a bit different, the folks may have an easier answer for you.



Thanks Dale.

When I used 3.0 it wasn't a problem - it wasn't case sensitive but 3.1 seems to be. I tried your example but it continues to throw php errors.

D
Dale 2/17/2007

Sorry Graeme,
I see, you are getting errors on logging in.
I was positive there was a post a few months ago about this exact thing, but alas my search cannot find it.

I am sure you would use the toupper snippet on the login page, but I am not at all familiar with the 3.1 code.
Maybe the folks can throw the solution up for you. I do know there were previous posts on this, maybe you will have better luck in search words.

T
thesofa 2/18/2007

Hi

you could run an update query on your users tabe and change all the usernames to lowercase, then tell your lazy teachers (you have them too?) to use lower case only.

It's an old trick, but it might just work

There is also this article about making text into uppercase only from the articles section, as well as this one about writing table data in uppercase only , in addition there is this article about entering names in propercase which might help.

HTH

G

G
gdude66 author 2/18/2007

Hi

you could run an update query on your users tabe and change all the usernames to lowercase, then tell your lazy teachers (you have them too?) to use lower case only.

It's an old trick, but it might just work

There is also this article about making text into uppercase only from the articles section, as well as this one about writing table data in uppercase only , in addition there is this article about entering names in propercase which might help.

HTH

G



Thanks Sofa,

I did that as a backup but the other solution would be better - unfortunately I can't get them to work with 3.1

J
Jane 2/19/2007

Graeme,
you can do it using BeforeLogin event on the Events tab.

Here is a sample:

function BeforeLogin($username, $password)

{

$username = strtoupper($username);

$password = strtoupper($password);

}

G
gdude66 author 2/19/2007

Graeme,

you can do it using BeforeLogin event on the Events tab.

Here is a sample:



Thanks Jane - I thought I tried this but maybe I didn't. I did convert all usernames to lower case as a temp fix. Will try you solution with a test database.