Heartless Adrenaline

PHP Conversion

HomeTutorials → PHP Conversion

Converting your site to PHP will make changing a layout extremely easier. Once converting to PHP, you will be able to change your layout throughout your entire website without any hassle. First, make sure that you have a) a basic knowledge of HTML and b) a webhost that provides PHP support.

First, code your layout. I will have a stubby one for an example:

<head><title>My Website</title></head>

<body>
<table><tr><td>

My content here!

</tr></td></table>
</body>

First, take everything from <head> (the first thing in the file) to <td> (the coding directly before the individual page's content) and copy & paste that into a PHP file called 'header.'
Then, take everything from </td> (the coding directly after the individual page's content) to </body> (the last thing in the file) and copy & paste that into a PHP file called 'footer.'

Now for the PHP includes! On each page, insert this code before the individual page's text:

<? $a = file_get_contents("/home/www/YOURWEBSITE.com/header.php"); echo ($a); ?>

Remember to change the URL to your website's header! Now insert this after your individual page's text:

<? $a = file_get_contents("/home/www/YOURWEBSITE.com/footer.php"); echo ($a); ?>

Remember to change the URL to your website's footer! You're done! Make sure your website looks good!
Just change the header and footer coding (like in the first steps) to change your layout!

I hope that this tutorial helped you. If you have any more questions, feel free to contact me here.