Welcome to WebDesignForums.net!
You're currently viewing WDF as a guest. By registering for a free account, you'll be able to participate with other members in our friendly community. Being a member allows you to ask questions and get answers for those troublesome web development tasks!

In addition, as a member you'll be able to post your websites up for review. Using our unique website review system you can gain some amazing feedback from some of the best web developers around. This is a completely free service to all registered members.

Ready to register yet? Registration is 100% free. Click Here To Join Now!

Need help making my website a referral site

Discussion in 'General Web Design Discussion' started by JSP1129, Apr 4, 2012.

  1. Offline

    JSP1129 New Member

    Message Count:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Gender:
    Male
    I want to make my website, so that when someone signs up to my program through it, they get a duplicate of my website for their use, with a referral number, so that they can promote it, and when someone signs up through them, they get the credit. And when someone signs up under them, they get a duplicate of the site and referral number, and so on and so forth, on down the line. How do I do that?

    Thank you for your time and help!

    James


  2. Offline

    mlseim WDF Staff

    Message Count:
    5,479
    Likes Received:
    224
    Trophy Points:
    63
    Gender:
    Male
    Location:
    Cottage Grove, Minnesota


  3. Offline

    Eric Mintz Member

    Message Count:
    46
    Likes Received:
    7
    Trophy Points:
    8
    Gender:
    Male
    Location:
    Atlanta, GA
    IF you don't have to register domain names for each new site (for example, each new site is like http://maindomain.com/website97), and IF you are doing this on your own Linux server (vs. shared hosting), then creating the sites is pretty easy (see below). You should be able to keep track of credits with some basic PHP (or equivalent) and SQL.

    First, set up a model website that you will copy from. Then, write a bash or python script (or equivalent) to:

    1) copy the web files from a model site into a new directory
    2) edit the config file (using "sed" to change the database credentials, etc.
    3) copy a template database into a new one for the new site (using mysqldump and mysql commands)
    4) create a new database user (mysql CREATE USER and GRANT commands)
    5) edit database records to customize for the new site (mysql UPDATE commands)

    A script like this should take about a day or so to design, write, test and debug.


  4. Online

    Webzarus Well-Known Member

    Message Count:
    3,001
    Likes Received:
    665
    Trophy Points:
    113
    Gender:
    Male
    And if they aren't running their own server, then ????


  5. Offline

    Eric Mintz Member

    Message Count:
    46
    Likes Received:
    7
    Trophy Points:
    8
    Gender:
    Male
    Location:
    Atlanta, GA
    That's a little trickier because it depends on the permissions you have granted to you on the server. For example, you could still perform similar logic using php, like making a copy of the web files and copying the database, but depending on the shared hosting setup, you might not have permissions to create a new database, or to copy the files into a new web root. In fact, most all shared setups won't allow this because they run PHP in CGI mode (rather than using mod_php) for security reasons - the CGI is configured to run not as an Apache user, but as the website owner.

    So in a pinch, I guess you can add new tables to your existing database (using table prefix names to keep the sites separate), and you can use subdirectories in the main webroot to hold the various generated websites. However there is a security issue since the owners of the different subsite are all running under the same server user account, so they would have access to each other's files and data. The web site itself would have to be configured such that owners of the subsites can't touch subsites owned by others.


Share This Page