Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Restricting Content

Options
  • 18-10-2011 2:19pm
    #1
    Registered Users Posts: 715 ✭✭✭


    I am building a new website at the minute. We are going to be selling a product online and want to have some extra content available to people who have purchased the product.
    For example, we want to have a link to a PDF that when clicked the user is prompted to enter their email address, if this email matches up with a list of the emails of people who have purchased from us then the content will download, otherwise an error will come up.
    Can anyone suggest the simplest way to do this?
    I have some knowledge of PHP and SQL but not enough to do this from scratch.
    Any direction would be much appreciated.


Comments

  • Registered Users Posts: 1,456 ✭✭✭FSL


    Hold your list of emails in a table in your database. Query the database using the entered email address. If no match display a message to the effect that the email as entered does not match any email used when purchasing and ask them to check the email typed is the one used when the purchase was made.


  • Registered Users Posts: 9,579 ✭✭✭Webmonkey


    You could pass the ID of the order and a hashed version of the email address into a link. When clicked, it checks the orders table for the id and looks up the associated email address. Does a hash on this and compares it to the hash in the link and if match then allow download.

    Similar to what is suggested above only a bit more secure perhaps.


Advertisement