PHP Syndication – How to Create the PHP Includes File

1. Copy the content you want syndicated into a separate file and save it as syndicate.txt. It can be named with any extension ie .txt, .html, .php, .shtml

2. Place this file into an includes folder and upload it to your server.

3. Insert the PHP includes file below between the body tags of the web page/site
where you want your content to be displayed.

<? include(''); ?>

4. Name the web page with a .php extension (ie syndicate.php)

Web pages using php syndication must use .php as an extension ie syndicate.php. If they use .txt, .html, .htm the page will not load and the syndicated content will not appear.


How to edit the .htaccess file for non-php web pages.

If the syndicated site only has web pages ending in .html or .htm edit the .htaccess file by inserting this code:

AddHandler application/x-httpd-php .php .htm .html
AddType application/x-httpd-php .php .htm .html

Make sure you upload the .htaccess file to the server.

Now any web site that has pages ending in .htm, or .html will be able to syndicate your web site content.

5. Upload the syndicated web page to your server. The syndicated content from your site will now appear on their site.

You can use the same php code on pages within your own site if you want your article headlines to appear there also.

My next post will discuss:

How to Syndicate My Article Headlines on Your Web Site With PHP Syndication:

Speak Your Mind