Advanced Search

Results 1 to 6 of 6

Thread: can i do this

  1. #1
    Join Date
    Feb 2010
    Posts
    21
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default can i do this

    hiiiiiii

    i am creating an register page i have set that login name and mailid should be different for users to provide that i have set login name and mailid fields to unique.... now what i need is how can i check this using php.....


    any suggestions plzzzzzz

  2. #2
    Join Date
    Jan 2008
    Posts
    4,103
    Thanks
    18
    Thanked 615 Times in 611 Posts
    Blog Entries
    5

    Default

    You want to make sure login name doesnt equal the mailid field?
    PHP Code:
    if($login_n == $mail_id){
      echo 
    "Its not unique...";


  3. #3
    Join Date
    Feb 2010
    Posts
    21
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    no what i said is same login name should not be used by the another user

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    11,797
    Thanks
    227
    Thanked 657 Times in 645 Posts

    Default

    1. Store info in a database (or text files if you can't use a database).
    2. When someone new registers, be sure that the info does not already exist in the database: make sure that searching for that email (or anything) returns false.
    3. Ask them to use another email if it did exist; if not, continue.
    Daniel - Freelance Web Design | <?php?> | <html>| Deutsch | italiano | español | português | català | un peu de français | Ninasoma Kiswahili | 日本語の学生でした。| درست العربية

  5. #5
    Join Date
    Feb 2010
    Posts
    21
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    I have already set to unique for that fields in database now my question is now i need to check that fields in my php coading how can i do that

  6. #6
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    11,797
    Thanks
    227
    Thanked 657 Times in 645 Posts

    Default

    Try to find the email address in the database. If the query returns no results, the email is unique. If you find a match, it is not unique.
    Daniel - Freelance Web Design | <?php?> | <html>| Deutsch | italiano | español | português | català | un peu de français | Ninasoma Kiswahili | 日本語の学生でした。| درست العربية

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •