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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Restricting Content

  • 18-10-2011 1:19pm
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 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, Registered Users 2 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