Jump to content


Photo

Usernames


  • Please log in to reply
4 replies to this topic

#1 Schlo_50

Schlo_50
  • Members
  • PipPipPip
  • Advanced Member
  • 468 posts

Posted 30 September 2006 - 09:46 AM

What code snippet can i use to make sure that my registration form doesn't submit, but instead displays an error message when a user tries to register but the username they have chose is already in taken?

Thanks guys!
-Schlo

#2 Schlo_50

Schlo_50
  • Members
  • PipPipPip
  • Advanced Member
  • 468 posts

Posted 30 September 2006 - 11:08 AM

8)

#3 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 01 October 2006 - 10:25 AM

You're going to need to allow the form to submit anyway.  Once it checks the database to see if the user exists, it either registers them or it spits out an error, returning them to the page, the fields can be pre-filled with the values they already entered.

Regards
Huggie
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#4 Orio

Orio
  • Staff Alumni
  • Advanced Member
  • 2,491 posts

Posted 01 October 2006 - 10:51 AM

Unless you use something like ajax to check.

Orio.
Think you're smarty?

(Gone until 20 to November)

#5 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 01 October 2006 - 11:45 AM

Unless you use something like ajax to check.


I didn't want to explain that route, am a little too hungover for that one :D

Regards
Huggie
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users