Jump to content

Username Increment


DavidY

Recommended Posts

Can you tell me how to use string methods to take all captured text and convert it to lower case? I also need to learn how to convert to uppercase plus allow for those other 8 characters.Can you tell me why you wouldn't disable keys or buttons?I can foresee the unwanted characters being used if the user is using a browser that is not compatible with Javascript so I will also need to be able to get PHP to reject the unwanted characters. The reason why I prefer to have characters disabled is that the user would in normal situations make only one attempt to register and they would not receive any rejections.Another thought I've had, is there a way to reject potential users if they are NOT using Explorer as their browser?
you're really not trying to make it easy for people are you? :)As "tempting" as you make think it is to disable keys, users make mistakes, it should be you're job as a developer to react to them, not inhibit them from being able to happen. People might think your site is broken, or breaking their computer if they don't get expected results from keys that they normally receive a response from when they hit it. Chances are most people will have have JavaScript enabled, so you should sanitize their input there first. When people submit, you should verify with PHP again before it goes into the DB, but you do have the option to let them know of their mistakes on the server side with PHP, so they can fix it. They should know if they input their values wrong, or else if you just change it on them, how will they know when they come back? Always communicate with the user, handle all edge cases by not taking away their normal key functions, but by anticipating them and provide conditionals in your code.you should be able to find everything you need about string methods in the w3schools javascript tutorials.
Link to comment
Share on other sites

oh yeah, you can use JavaScript to conduct browser sniffing, even though that contradicts almost all the advice I just gave you.

Link to comment
Share on other sites

you're really not trying to make it easy for people are you? :)As "tempting" as you make think it is to disable keys, users make mistakes, it should be you're job as a developer to react to them, not inhibit them from being able to happen. People might think your site is broken, or breaking their computer if they don't get expected results from keys that they normally receive a response from when they hit it. Chances are most people will have have JavaScript enabled, so you should sanitize their input there first. When people submit, you should verify with PHP again before it goes into the DB, but you do have the option to let them know of their mistakes on the server side with PHP, so they can fix it. They should know if they input their values wrong, or else if you just change it on them, how will they know when they come back? Always communicate with the user, handle all edge cases by not taking away their normal key functions, but by anticipating them and provide conditionals in your code.you should be able to find everything you need about string methods in the w3schools javascript tutorials.
Making it simple is precisely what I'm trying to do. If you look at my very first question I stated I'm wanting to have two types of members, one recognised with lower case in their username and the other recognised with uppercase in their username. By disabling the keys it will make it very simple for users because they will not be able to insert the wrong case in the wrong catagory. When a user makes a mistake I have enabled the backspace key to correct any mistake and if they register a username that they at some later date want to change then they will be welcome to do so. The username box will be labelled as to what keys can be used so users should not think their computer is broken. I don't intend changing usernames without telling users. Yes, I'll have to get PHP to check for any mistakes or illegal characters.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...