How to create a cross-domain script?

Discussion in 'Programming' started by NLZ13, Mar 14, 2011.

  1. #1
    I am planning to make a script but I have a question which is very important before beginning.

    On the main website, domain.com there will be the info of using the script. Everybody can register and use the script so it will run on sub.domain.com. But I also want to make it possible that people can pay for using the script on a chosen .com.

    Now what is the best way to do this. Like if there is an update there is no possibility I have to change the files on every hosting manually.

    (In no way the users can get the source of their script, they can only use there registered version)
     
    NLZ13, Mar 14, 2011 IP
  2. SimThePhpCoder

    SimThePhpCoder Well-Known Member

    Messages:
    949
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #2
    Id also like to know how to do this =)
     
    SimThePhpCoder, Mar 15, 2011 IP
  3. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #3
    So you have functionality on your site (as you dont say what it is lets say its a tax calculator) and you want other people to be able to add the same functionality to their site without you having to give them the source code.

    One option is to create a webservice and so their site passes you their login credentials along with the data, your site runs the function and returns to them the results. The advantages of this is that they can then style things exactly how they want, they can use it with any programming language not just the one you like to use and if you change the logic in the function there is no need to redistribute it. The disadvantages are that it will be more complex for them to integrate, you cannot enforce them showing their using your system and it will be more complex for them to update if you change the input or output parameters

    The other option is to simply encrypt your source code and distribute it as a solution to run on their servers. The advantages/ disadvantages are more or less the reverse of the other solution but you would be sensible to include a remote kill code for each license if your wanting to enforce continued subscription etc.
     
    AstarothSolutions, Mar 15, 2011 IP
  4. NLZ13

    NLZ13 Well-Known Member

    Messages:
    166
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    113
    #4
    The script actually is comparable with bux websites like the sites from buxhost.com
    The main website is information that people can use. when user registers he gets a subdomain like user.bux.com and there evereybody can use his bux website and his users and himself can earn money.
    This is easy because I can set make one script and every subdomain can use this script with the right settings. But now is the problem how can I fix this when users can get their own .com domain.

    Won't it be too slow if every customer will use the same database, script and host?
     
    NLZ13, Mar 15, 2011 IP
  5. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #5
    How slow it would be will depend on the volumes of data, efficiency of the programming and the specification of the servers/ connections.
     
    AstarothSolutions, Mar 16, 2011 IP
  6. NLZ13

    NLZ13 Well-Known Member

    Messages:
    166
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    113
    #6
    That's true, but will it be possible to run a script on example.com and just access this script from every other .com domain with the right settings?
     
    NLZ13, Mar 16, 2011 IP
  7. lukefowell89

    lukefowell89 Peon

    Messages:
    182
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I had this same problem when I developed a eCommerce platform, where I wanted to continually give my clients upgrades as they arrived as part of the initial agreement. The best and fastest way I found of achieving this, is to create a template of what you want to include, which contains information that will never change (hopefully) and then include the rest from a remote database. Every client on the system updates as soon as you have updated your database.

    You can even include some kind of script initially on each client, where when the page is loaded, check if there is an update from comparing a version number that will be stored on the client side, and then another stored on a database on the remove server. If they dont match then, get the user to include the update. This include could always been stored locally by the client too.
     
    lukefowell89, Mar 16, 2011 IP
  8. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #8
    To be honest it all depends on what you are really wanting to achieve, the short answer is yes, you can. How its best to do it depends on what exactly it is that the site/ function is.
     
    AstarothSolutions, Mar 16, 2011 IP
  9. NLZ13

    NLZ13 Well-Known Member

    Messages:
    166
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    113
    #9
    Thanks a lot, this helped me out a lot.

    Indeed and this is my question the site function is really close to compare to the bux system I described.
     
    NLZ13, Mar 16, 2011 IP
  10. lukefowell89

    lukefowell89 Peon

    Messages:
    182
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #10
    glad to of helped!
     
    lukefowell89, Mar 18, 2011 IP
  11. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #11
    I don't know what the "bux" system is and don't really have the time to investigate websites to try and guess which functionality you are wanting to replicate.
     
    AstarothSolutions, Mar 18, 2011 IP
  12. NLZ13

    NLZ13 Well-Known Member

    Messages:
    166
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    113
    #12
    Don't need to, I already described the functions in this thread
     
    NLZ13, Mar 18, 2011 IP
  13. SimThePhpCoder

    SimThePhpCoder Well-Known Member

    Messages:
    949
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #13
    I just thought of a way to do, JavaScript.
     
    SimThePhpCoder, Mar 18, 2011 IP
  14. NLZ13

    NLZ13 Well-Known Member

    Messages:
    166
    Likes Received:
    3
    Best Answers:
    1
    Trophy Points:
    113
    #14
    I really don't understand what you mean :D
     
    NLZ13, Mar 19, 2011 IP
  15. SimThePhpCoder

    SimThePhpCoder Well-Known Member

    Messages:
    949
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #15
    look up external js php
     
    SimThePhpCoder, Mar 19, 2011 IP