#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2011
    Posts
    198
    Rep Power
    3

    Locating Another User


    Hi, my site allows users (buyers) to buy e-learning courses for other users (receivers). The buyer completes a form, entering in the receivers email address along with choosing an e-learning course for the receiver. These e-learning courses are presents (mostly surprises) and the majority of the time a buyer will not know if a receiver is already a member or not.

    When payment is processed and the form is submitted, the site checks if the receiver is already a member, by checking if their email address is already associated with a user account, and therefore the site sends out 1 of 2 emails to the receiver:

    A (receiver is already a member) - "you have received a new e-learning course from $buyer"

    B (receiver is not a member) - "you have received a new e-learing course from $buyer, please click on the following link to complete your account"

    Now i am thinking of adding a way so that the buyer can find / locate the receiver instead of just guessing / entering in the receiver's email address, as a receiver might use a different email address than the one the buyer knows to create their account on the site.

    What is the best way to do this... i think it would be illegal to add a "search receiver by email" to the site, as this would allow users to enter in an email address and then if an email address is found, the site will auto display the user's first name and last name and username. I was then thinking maybe it is best to search for user by username... so if there is a result the site will auto display the usernames first name and last name only. Buyers can then focus on finding out the receivers username from them instead of the email address they signed up with... what do you think is the best approach... thanks in advance for your help...
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,337
    Rep Power
    594
    Are you talking about doing an internet email search rather than your database? If so, that would not necessarily be illegal but it would certainly be unreliable, difficult to parse and could produce hundreds of addresses for the buyer to choose from. How would the buyer necessarily even know which is right? I suggest that if the name and/or email address is not in your member database, just accept the email address given by the buyer.

    You could monitor that email and notify the buyer if it bounces but that is about the extent of it.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2011
    Posts
    198
    Rep Power
    3
    Hi, no... not a search on the internet... just a simple search to see if the a user account exists in the database with that email address that is being used for the receiver
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,337
    Rep Power
    594
    Then you need to explain the problem better. What have you done so far to query your database and what is going wrong?
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  8. #5
  9. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    It's not illegal, but probably not a very good idea.

    I've built a system that faced virtually the same problem. The way we solved it was handling it on the receiving side rather than the sending side. The sender enters the E-Mail address that they know. When the receiver accepts the gift, they are given the option to log in with an existing account or create a new account. In neither case does the account the receiver authenticates with need to match the one the sender entered, the gift is simply updated to reflect the E-Mail address that the receiver prefers to use.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2011
    Posts
    198
    Rep Power
    3
    Originally Posted by E-Oreo
    It's not illegal, but probably not a very good idea.

    I've built a system that faced virtually the same problem. The way we solved it was handling it on the receiving side rather than the sending side. The sender enters the E-Mail address that they know. When the receiver accepts the gift, they are given the option to log in with an existing account or create a new account. In neither case does the account the receiver authenticates with need to match the one the sender entered, the gift is simply updated to reflect the E-Mail address that the receiver prefers to use.
    Hi, that sounds great... can you elaborate a little more please...

    So, the email is sent off to the receiver (to one of their email addresses)... what is in the email when the receiver gets it... i presume some sort of link to a page... then what is on this page and how can the receiver link the gift to an account on a different email address... thanks for your help
  12. #7
  13. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    Yes, a link to a page to accept the gift. On the page the receive is given two options: log in with an existing account, or create a new account. If the user logs in with an existing account, the gift is tied to the account they just logged in with regardless of whether or not the email address on that account is the same one that gift was sent to. If the user creates a new account, the gift is tied to the new account regardless of whether the email address on that new account is the same one the gift was sent to.

    Initially the gift is tied only to an email address. After it is accepted, it is tied to a user id and the email address link no longer matters.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2011
    Posts
    198
    Rep Power
    3
    Originally Posted by E-Oreo
    Yes, a link to a page to accept the gift. On the page the receive is given two options: log in with an existing account, or create a new account. If the user logs in with an existing account, the gift is tied to the account they just logged in with regardless of whether or not the email address on that account is the same one that gift was sent to. If the user creates a new account, the gift is tied to the new account regardless of whether the email address on that new account is the same one the gift was sent to.

    Initially the gift is tied only to an email address. After it is accepted, it is tied to a user id and the email address link no longer matters.
    Excellent, has this been working ok for you so far...
  16. #9
  17. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    Yes it works fine
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2011
    Posts
    198
    Rep Power
    3
    Originally Posted by E-Oreo
    Yes it works fine
    Sorry, one more quick question.

    When the course is purchased, the new course needs to be recorded in the database. I link the receivers of these users to these orders using a $receiver_id which is then used to look up the receiver in the user table

    So when a buyer buys a course, should i partially create the receivers user account using the email address that the buyer provided... and then just delete that user account if the receiver decides to accept the course using a different log in / account that they have already set up
  20. #11
  21. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    On second thought, yes that sounds like a good idea. just make sure you have a flag in your users table to indicate that the user is incomplete.
    Last edited by E-Oreo; October 12th, 2012 at 05:53 PM.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  22. #12
  23. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2011
    Posts
    198
    Rep Power
    3
    Yes, i have a status for each user... these temp users will be assigned a 'waiting' status

IMN logo majestic logo threadwatch logo seochat tools logo