SKYR0SE DOT COM

welcome

Welcome to Sasha's gfx corner Skyrose, here to provide quality resources since May 2014; take a look, read the Terms, grab whatever you like and enjoy. <3

updates

June 18, 2024
♥ v28 layout
♥ 4 textures
♥ 4 gradients
♥ 12 colors

January 02, 2024
♥ v27 layout
♥ 8 backgrounds/patterns
♥ 8 textures
♥ 6 gradients
♥ 2 banners
♥ 4 colors
♥ misc. tuts changes

November 11, 2023
♥ v26 layout
♥ 40 colors
♥ colors revamp

September 25, 2023
♥ v25 layout

April 14, 2020
♥ v24 layout
♥ 12 textures
♥ 4 gradients
♥ 2 banners
♥ 4 colors

October 01, 2018
♥ v23 layout (Halloween theme!)

Navigation

Back pats Banners Textus Colors Gradients

HTML Tuts CP Tuts Ps Tuts PHP Tuts Misc. Tuts

chat with me

Affiliates

PHP Include

The title makes it sound bad, but PHP Include is actually quite easy.
There are in fact no special skills required for it, all you need is a good HTLM/CSS/PHP editor - personally, I suggest one of the below. But let's start with the instructions.

Firs thing is you have to do is to make - or to download - an HTML page; when you open it with your chosen editor, you'll notice the page will have the following structure.

<!DOCTYPE html>
<html>
<head> --> this and the above make the header in all HTML pages
<title>page title</title> --> the page title (only modifiable between > and <)
<link href="stylesheet.css" rel="stylesheet" type="text/css" /> --> link to stylesheet </head> --> this closes the page's header

<body> --> this starts the page content (elements to be visible must be between body and /body)

<div id="navigation">navigation here</div> --> the site links will be here

<div id="content">content here</div> --> all the content will be here

</body>
</html> --> the last two elements close the page


The above is how any basic HTML page is built, and you start from that to create PHP Include.

Now put the HTML page you have above aside for a moment and, with your chosen editor, create three php files and call them head.php, foot.php and index.php.

The first file, head.php, is where the HTML page's header goes; you simply copy the code on your HTML page and paste it on the file. For the file to work, the code has to look like shown here below.

<!DOCTYPE html>
<html>
<head>
<title>page title</title>
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
</head>

<body>

<div id="navigation">navigation here</div>

<div id="content">


Now you do the same copy and past routine with the second file, foot.php; final code has to look like below.

</div>

</body>
</html>


Now, open the index.php file and paste the following code twice, on both page top and bottom.

<?php include(''); ?>

You then insert head.php and foot.php in the brackets' empty spaces, until code looks like shown below.

<?php include('head.php'); ?>

content here

<?php include('foot.php'); ?>


Now, you just have to insert your content between the two php snippets - where my example says 'content here'.
There, PHP Include is done.

I alomst forgot: the file names are not mandatory; as long as you match the parts I showed you to your files names, you can rename the three files to whatever you want.

NOTE :: To have your full site done with PHP Include, you just have to copy the index.php for how many times how are your pages and edit the spaces between the php snippets with your content.

© Sasha • 05.2014 // Hosted by BS // v28 Ana Beatriz Barros // Design :: FH // Photos :: MF // Powered by CN // Admin :: CP - CMS