Jump to content

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/261841-php-class-to-control-multiple-websites/
Share on other sites

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).

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

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.