ivalea Posted September 29, 2006 Share Posted September 29, 2006 First, let me say, please bear with me as I am uncertain if this is in fact the correct way to go in creating this contribution. I'm not well versed in writing php/mysql but have not problems editing it. And, I hope I'm posting this in the correct place..... I am looking into how to go about creating a membership contribution. Here's how I want it to work. I am going to be offering different training classes. These files will be put into a dir. called /training/m1, /training/m2 and so on. Courses can then be added in the admin just like any other product with the product model entered corresponding to the different directories containing each class (m1, m2...). So when a customer purchases one of the courses, they will gain access to only the corresponding directory through a link shown in account.php. I thought that this method might be the easiest way to go about this but am unsure of how to handle certain issues that I think may arise: 1. How to keep members out of the directory that they did not purchase? For instance if I purchased m1, I shouldn't be able to access m2. It's not enough to just not show that link as anyone logged in and paying attention to their address bar can easily type in the url they want to get into. 2. I noticed that the product model only gets inserted in the products table in the db. So how would I write the select statement to pull not only the cust.id, but the product model corresponding to their past purchases? I think that may be it. Again, if I'm trying to go about this the hard way and there is an easier way to accomplish this I would definately be open to hearing it. Or even if someone can perhaps write this mod to work the way I described I would pay for it. Any help at all though would be so appreciated. My deadline for this site is the middle of next week. THANKS! :) - Irene Quote Link to comment Share on other sites More sharing options...
skylla Posted September 29, 2006 Share Posted September 29, 2006 The simplest solution is to password protect a folder (through your php.ini or .htaccess) and supply a username and pwd after purchase. You could further restrict access by IP address to prevent distribution of username and pwd. Again, this would be the simplest solution. Quote Link to comment Share on other sites More sharing options...
ivalea Posted September 29, 2006 Author Share Posted September 29, 2006 Thanks for the tip Skylla - so basically they would have two different logins - so would the .htaccess file be placed in the root of the directory they will be accessing? Sorry for the lame questions... :) Quote Link to comment Share on other sites More sharing options...
skylla Posted October 3, 2006 Share Posted October 3, 2006 well, only create an .htaccess if you do not have access to your php.ini since the latter is the preferred way. The .htaccess file is best placed in the folder you want to protect, linking to a file containing your pwds away from the public domain (i.e. at least one folder up from your www/ folder). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.