Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 293763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:18:19+00:00 2026-05-12T06:18:19+00:00

Here’s how it works: User makes a payment User receives a password Their user

  • 0

Here’s how it works:

  • User makes a payment
  • User receives a password
  • Their user name will be their email
  • A folder will be created for that user, which contains the files the user paid to have access to.

My main problem is that the software needs to be protected, and the password will be dynamically created. So I’m wondering if I need to create an .htaccess and a .htpaaswd, if that’s the case, how would can I do this dynamically?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T06:18:19+00:00Added an answer on May 12, 2026 at 6:18 am

    Probably the same way WordPress creates/modifies a .htaccess file.

    You simply need to create a script that will generate the correct file contents for a .htpass or a .htaccess file.

    When a user purchases something, add a line to the .htpass file that contains the user/pass combination, and all them to a group (probably based on filename). Then, only allow that group to access that file.


    Another way to do this would be through databases.

    First, when the user makes a payment, have a few tables to store their data.

    First Table: User/Password

    This stores the email/password combination that must be used to gain access to the users files. Basically the table consists of

    int Unq_ID | text Email_Addr | varchar(150) Password

    That holds your user/pass combinations.

    Second Table: Files

    This table holds all of your files names, IDs and where they are created.

    int Unq_ID | varchar(150) Name | text Directory

    Third Table: Relationship

    This last table holds the relationship between the User and the Password. Also very simple:

    int Unq_ID | int User_ID | int Product_ID

    Basically, if the person logs in with a valid Username/Password, you go grab relationship entries that match their User_ID, and join the files with on the Product ID. To verify they can download something, simply check that an entry exists that has the right User_ID and Product_ID.


    To protect a file from being accessed, make an htaccess file like this

    RewriteEngine On
    RewriteBase /
    RewriteCond %{THE_REQUEST} ^.+$ [NC]
    RewriteRule .* - [F,L]
    

    which deny from anyone accept PHP’s fopen function. Then you just create a PHP script that grabs the contents, and presents it as a download.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's a query that works fine: SELECT rowid as msg_rowid, a, b, c FROM
Here's the flow that I am trying to achieve: 1) User uploads an audio
Here is the scenario: I'm writing an app that will watch for any changes
Here is the code in a function I'm trying to revise. This example works
Here is the code: create table `team`.`User`( `UserID` bigint NOT NULL AUTO_INCREMENT , `Username`
Here's what I'm trying to accomplish with this program: a recursive method that checks
here is my configuration: http://domain.com (obviously fictitious name...) hosted on a server running Apache
Here is the problem that I am trying to solve. I have two folders
Here is what is supposed to happen: The moment the user chooses an option
Here is my code (Say we have a single button on the page that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.