Warning: include() [function.include]: http:// wrapper is disabled in the server configuration by allow_url_include=0 in /home/blackst/public_html/tutorials/phpinclude.php on line 1

Warning: include(http://black-stripes.net/header.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/blackst/public_html/tutorials/phpinclude.php on line 1

Warning: include() [function.include]: Failed opening 'http://black-stripes.net/header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/blackst/public_html/tutorials/phpinclude.php on line 1

PHP Include


PHP Include is an easy way to update your site without editing every single page. I use this to easily edit my layout and sidebar.


1. Your site needs to be converted to PHP. This means you have to change every extention, .html og .shtml or whatever, to .php. Remeber that all the links on your site needs to be changed too when you do this. There can't be any .html pages left in your directory! Delete them and upload the php ones.

2. Make a new document which you call header.php In this, post the top of the page. In my header, I have everything from the first < head > tag, site title, scrips, layout, sidebar, right down to the size decitions for the content bar. Make a document which you call footer.php. Here, post the bottom of the page, just < /body> < /html>, like i have, and eventual copyrights, links, etc if you have that.

3. In every page on your site, erase everything you put in header.php, and paste this instead;

<? include("header.php"); ?>

and excange what you put in footer.php with this;

<? include("footer.php"); ?>

Now upload all the php files to your directory, and you can from now on change everything just by changing and uploading header.php or footer.php!
Warning: include() [function.include]: http:// wrapper is disabled in the server configuration by allow_url_include=0 in /home/blackst/public_html/tutorials/phpinclude.php on line 20

Warning: include(http://black-stripes.net/footer.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/blackst/public_html/tutorials/phpinclude.php on line 20

Warning: include() [function.include]: Failed opening 'http://black-stripes.net/footer.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/blackst/public_html/tutorials/phpinclude.php on line 20