Xdega Posted April 30, 2012 Share Posted April 30, 2012 Ok. This one may be tricky to explain, but I will try. I am going to be looking at an idea for a PHP Class that can control the content of multiple websites via a DB. Basically, what it will do is use a database backend to set a "pointer url" that can be turned on or off for any hosted/connected domain in the database. This will be a system that can turn off potentially 100s of websites for "maintenance" or just disable inactive websites in an elegant manner (direct the url to the creator of the website). Here it is in bullet point form, to try and explain better: - User Visits a web page - A PHP class at the top of the page, queries the DB (hosted at the web developers end) -The user is directed to the appropriate url depending on the DB setting. -URLs that could be directed include the following (Maintenance, Website Inactive, Third-Party Redirect). NOTE: If a DB connection is unable to be made, then the website just loads as normal. (or die?) I am unsure where to start on the design of this, I am also concerned about any potential performance issues that may need to be accounted for? Anyone have any input from a design perspective on how to properly approach this? Quote Link to comment https://forums.phpfreaks.com/topic/261841-php-class-to-control-multiple-websites/ Share on other sites More sharing options...
ignace Posted April 30, 2012 Share Posted April 30, 2012 I fail to see how this seems challenging? Use the host address to query the DB for the website details SELECT * FROM websites WHERE domain = 'website.com' and the content SELECT * FROM content WHERE domain_id = 1. Sure there are a few caveats (www.website.com versus website.com being just one). Quote Link to comment https://forums.phpfreaks.com/topic/261841-php-class-to-control-multiple-websites/#findComment-1341717 Share on other sites More sharing options...
Xdega Posted April 30, 2012 Author Share Posted April 30, 2012 I understand the concept is not very difficult. What I am more concerned about, is if there are any performance caveats or subtleties I need to consider, in the presumption that this class could be used on a large scale (100s, 1000s or URLs). In other words, I want this to be as heavily optimized as possible. If there is not anything that needs to be considered in terms of the above, then fair enough. Just wanted to make sure. thx Quote Link to comment https://forums.phpfreaks.com/topic/261841-php-class-to-control-multiple-websites/#findComment-1341805 Share on other sites More sharing options...
Adam Posted May 1, 2012 Share Posted May 1, 2012 I don't follow how this is supposed to work. When you say "directed", are you talking redirecting users to another site after they have hit yours? Quote Link to comment https://forums.phpfreaks.com/topic/261841-php-class-to-control-multiple-websites/#findComment-1342000 Share on other sites More sharing options...
Xdega Posted May 1, 2012 Author Share Posted May 1, 2012 I don't follow how this is supposed to work. When you say "directed", are you talking redirecting users to another site after they have hit yours? It will be a dynamic re-direct management via DB, that can control several websites via an eventual backend. Effectively turn them off, Shut them down etc, or otherwise just redirect their URLs to the developer homepage if there is an issue w/ the initial referral url. Basically to clarify, there will be a couple of lines at the top of a page. That will create an object and use the class to redirect the web-page appropriately. Of course it will not "always" redirect, most of the time it will not, it will just serve as a dynamic means to redir a websites traffic if need be. Quote Link to comment https://forums.phpfreaks.com/topic/261841-php-class-to-control-multiple-websites/#findComment-1342103 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.