PHP Content Rotation

[434 Clicks]


Content Rotation With PHP

Since search engine spider robots check what's been altered since the previous crawl, you need to have a method of alteration that insures your page remains interesting to it so your page rankings remain relatively high. Rather than reword the content manually for each visit, use an automatic method which is also easily and speedily appendable as it's structure is a template. First, create any number of HTML pages that you'll need for the project. Name them content1.html, content2.html, etc (or whatever title works for you).Then, you'll create the page which'll actually be calling the content displayed from the seperate html pages created previously. The coding for the template is;

$newcontent = array("content1.html","content2.html","content3.html");shuffle($newcontent);

Simple, and lightweight, this coding'll help your page load in faster also. This method works well for presenting personally-created web pages where you're the one who determines what the content will be. But, if you're looking for a way to both save large amounts of time AND provide automatic content updating, this is where RSS feeds come in. Open your favorite web document editing program (whether you use Dreamweaver CS4 or NotePad2 - it's free! Google please!) and create a page with a .php extension. Code as follows;


include("RSS FEED URL");


One word of caution: If this process doesn't display the feed contents, this is a problem that can be solved in either of two ways. Since you need the webspace you'll be displaying the page from to have fopen (or fsockopen as it's also known) enabled to allow the feed to be called by that web page. If your host allows the use of .htaccess files, you'll have an awesome workaround. If your host restricts the usage of .htaccess files, you must work directly with them to have the function opened (some hosts are great if you ask nicely enough or offer a donation or attempt to barter services - if you're skilled enough). If by some reason this doesn't work either, make sure you're subscribed to the feed.

Resource Box


Mr Lee Davis is the owner/admin of, an instant publishing site for news, articles, information, multimedia, and infographic submissions along with exposure to profitable opportunities associated with content creation. Are you a content creator in need of a way to double your content output while halving creation time? Info can be found at the 100% UNIQUE Articles salespage


Content Rotation, PHP