x x x x x
ink ablaze

homepage
content
beauty & style
profile
about the site
archives
poetry & fiction
inspiring words
tagboard
affiliates
PHP Includes

So, in order to get these to work correctly there are a few steps you have to take to make everything run smoothly. Read on below to find out more...

.html files must be changed to .php :

All files that you publish to the internet have a file extension, just like they do on your computer. This specifies whats inside your document so the internet can display it correctly. ".html" or sometimes ".htm" (same thing) is the default. When starting out your web pages you always have a file called "index.html" or "home.html" this is your homepage. The first thing people see when they go to www.yoursite.com.

Change "index/home.html" to "index.php". Any file you intend on having a php include code in must always have a .php extension. If its .html or anything else your files will not show up! This is something you will likely use on pretty much every page, so get into the habit of creating all your files in .php format.

save your php include files as .txt :

In your File Manager root folder(the place where you see the "images" folder, your index.php file, and all other webpages you've created) its recommended to create a folder for all your php include files. To keep everything organized and easy to find. We will call this folder "content" . Once your content folder is there, upload or create files to put in there! Lets start with something easy, like your website header or sidebar/navigation bar.

You can copy paste the content of your php include file directly from your html layout, html code included! When you have your stuff pasted into your file, save it as a .txt extension. For example: "sidebar.txt"

put your .txt file from the content folder into your phpinclude code:

Once we have files saved and ready for use, all we need to do is insert it in the include code, like this:

sidebar.txt becomes:

<?php include("http://yoursite.com/sidebar.txt"); ?>

- or -

<?php include("content/sidebar.txt"); ?>

And thats all it takes! Reuse and Repeat as many times as you want with as many different files as you please!

Still need a little help? I'll show you what to do with my step-by-step guide (complete with screenshots):

J PHP Includes: A Step By Step Guide  J

 


So what other kinda cool stuff can you do with PHP codes? Remember php includes are only one type of code you can use. There are a lot of fun and useful scripts for php out there. Comment forms, email forms, just to name a few. Here are some great links for other php goodies: Not-Noticeably.net , Hot Scripts

*here is a helpful hint: if you choose to use the faq form & email contact form offered by not-noticeably (these are what i use for my website also), I have discovered that for whatever reason, yahoo mail does not send the email message to you; even if the form is coded correctly. If you have a yahoo email you'd like to use for these; just set up an email account with gmail and set all messages to automatically forward to your yahoo email.

it took me forever to figure out that glitch! i wanted to give you a heads up so you didnt encounter the same problem :)


 

...does it get any easier?

Actually, YES! it does!

Once you understand the basics of the php include code, you can take things to the next level and make managing, writing, and updating your site even easier by incorporating a Content Managment System (cms for short). The cms im going to show you already uses the php include code and allows you to edit every file in your content folder and update them all from one screen! Read on...

CMS: The Easy Guide