Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Need help on finding if a username is taken or not on mu join script...
Old 01-28-2006, 02:20 PM Need help on finding if a username is taken or not on my join script...
-_darkranger_-'s Avatar
Super Talker

Posts: 122
Location: bolton...
Trades: 0
Right well, im using php for my alt community website and recently someone suggested that i should put something on so someone could check the username they imputed was already in use without having to submit the whole join request...

Im not sure how to do it, but i do have ideas on methods...
- use js to open up a winow with the url of index.php?page=checkusername&username=*what they inputed* and do the rest with php
- use js its self to check the database
but i dont know which is better and i dont no how to do either so please could some help me...?

thanks in advance xx

xx kieran xx

Last edited by -_darkranger_-; 01-28-2006 at 03:47 PM.. Reason: correcting typoes
-_darkranger_- is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-28-2006, 07:54 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,520
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
no choice really as clientside javascript can't actually access the database.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-28-2006, 08:23 PM
-_darkranger_-'s Avatar
Super Talker

Posts: 122
Location: bolton...
Trades: 0
ah, i thought it possibly could. Ah well

Ive actualy had another poissble idea sinse...
make it so that js files are processed by the php thing :P then put every single username that is already taken into a js array... link the js file to the join script... and *somehow* make it so that you can click a link and the text appear below it saying if its been taken or not...
-_darkranger_- is offline
Reply With Quote
View Public Profile
 
Old 01-29-2006, 06:28 AM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,520
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
that would be possible BUT you will then expose every user name in the database in the client-side source.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-29-2006, 06:33 AM
-_darkranger_-'s Avatar
Super Talker

Posts: 122
Location: bolton...
Trades: 0
Yea but thats nothing you couldnt find out anyway from searching, and its not like its passwords or something that should be kept secret...

But anyway, what would be the most effective way...?
-_darkranger_- is offline
Reply With Quote
View Public Profile
 
Old 01-29-2006, 07:35 AM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,520
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
usernames can be used with a SQL injection attack or a brute force/dictionary attack on weak passwords so could make your system vunerable.

Personally I have never bothered checking before a submit, I just collect all the other data in the form and present it back to the user and "flag" the missing items and/or show a message. In the case of usernames you can present some alternatives in the MSN Passport/Gmail/Googletalk style using the user input and some random numbers, if you ask for a first name and surname you can offer alternatives based on that input as well, couple that with a radio button to select one and away you go again.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-29-2006, 08:34 AM
-_darkranger_-'s Avatar
Super Talker

Posts: 122
Location: bolton...
Trades: 0
i really dont wanna submit all the information cause that would involve me messing around with the back end of it lol im lazy atm :P

so how about i open a new window to a php file and the php check if its being used and if it is then display other options ... ? :P

so how do i do that it would need to open up index.php?page=misc&do=usercheck&user=*username inputed*&alt=*first name inputed* please help
-_darkranger_- is offline
Reply With Quote
View Public Profile
 
Old 01-29-2006, 03:37 PM
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,520
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
I'll have a play and see what I come up with when I'm back at my own desk
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-29-2006, 05:43 PM
-_darkranger_-'s Avatar
Super Talker

Posts: 122
Location: bolton...
Trades: 0
thanks dude
-_darkranger_- is offline
Reply With Quote
View Public Profile
 
Old 01-30-2006, 05:57 PM
funkdaddu's Avatar
Web Design Snob

Posts: 635
Trades: 0
You can write a PHP script that checks for the username, and returns a t/f value and use XMLHTTPRequest to get the variable before submitting the form. If the XMLHTTPRequest returns true, give the user an error, if false, then process the form. I'd put username checking in the processing script regardless, just in case someone doesn't have JS or bypasses it.
funkdaddu is offline
Reply With Quote
View Public Profile Visit funkdaddu's homepage!
 
Reply     « Reply to Need help on finding if a username is taken or not on mu join script...
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.29839 seconds with 12 queries