Go Back   Webmaster Forums UK SEO SEM Webmaster Community Forum - UKWW > General > General Webmaster Talk
Register FAQ Members List Downloads Calendar Today's Posts Webmaster Resources Webmaster Blogs
 
 

General Webmaster Talk General webmaster discussion forums - In this forum and its sub forums you can discuss general webmaster related issues or even issues that does not related to Webmastering.
Sub Forums: Running a forum :: Blogs and Blogging :: Word Press Forums :: Digital Photography

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-19-2005, 08:58 PM
Senior Member
0 posts this year. needs some grease!
New user, who has not interacted much yet.
 
Join Date: Jul 2005
Posts: 247
Thanks: 0
Thanked 0 Times in 0 Posts
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Send a message via MSN to stealthhosts
Arrow Using 'includes' to increase your standards and reduce your workload

See - save you effort, time and enable you to create standrds driven pages with ease. this is a bit long but it is only an overview so please read it if you are not already using includes to create your pages


Using includes to create a web page:
It is my opinion that any webmaster worth a biscuit should be using inclides in their page design. As such, for those who don't, I have written a short tutorial in what they are and how to use them. I hope someone finds it useful.

What is an include?:
An include statement is named after exactly what it is! An instruction to the web server to include one file within another. For example, if I write a webpage have it formatted as follows:
HTML Code:
Hi

My webpage
I would like to add ‘this is’ on the empty line but I don’t want to type ‘this is’ on every page I want it to appear (start thinking bigger and look at headers, footers, avigation areas etc).
I “COULD” type ‘this is’ on every page I wanted it to appear, but that seems like a lot of effort. I just want to type it once because I am a typical web developer and I want to find the path that creates the least amount of work. – keep reading and you will see why……………….
I will use php in this example but I will explain the ASP version later on.

So, I have my page formatted as above, but this time I create a new page that simply contains the words ‘this is’ and I save it as include_thisis.php (the filename is not important) .Then I go back to my original page and change it’s source to read:
Code:
Hi
PHP Code:
<?php include(‘include_thisis.php'); ?>
My webpage
So, when anyone views my page now, they see the text from my main page and then where I have included my ‘this is’ file, they see the contents of that file.
My page now appears as :
Hi,
This is
My webpage


I can now include that file anywhere that I want ‘this is’ to appear. Whilst that is, in itself a useful tool for any text, image or ANY content whatsoever that you wish to repeat throughout your site, it’s usefulness does not stop there. If I decide that my pages need a change, I don’t want them all to say ‘this is’ anymore, I want them all to say ‘that was’ instead. Laziness kicks in again (actually, it’s good web practice, but that’s a bonus) and I don’t want to go through all of my pages finding and replacing. Lucky me, I used includes. I go back to my include_thisis.php file and change the text from ‘this is’ to ‘that was’
ALL of my pages that hade the include statement in, now say ‘that was’:
Hi,
That was
My website


Now, if you have a navigational bar on your site and you add a new page, do you really want to go through adding that link to every single page, then, what if you spell it wrong on one of 30 pages, would you know which? FAR better to have it wrong on all of them and very easy to spot and then fix (by changing your one include file).

ASP/PHP:
Whatever your server side language, there is a similar piece of code that enables you to use includes.
In PHP :
PHP Code:
<?php include('filename.php'); ?>
In ASP:
PHP Code:
<!--#include virtual="filename.asp"--> 
This is a VERY high level simplistic explanation I have written as an introduction to includes. If you would like some examples I can quickly put some together for you, or feel free to ask me.
It is important to understand that these are not FRAMES which should be avoided at all times by all but the most inexperienced web developer as they can create far more problems than they solve. To your visitors all they see is one page (and it looks like you did a hell of a lot more work than you really did).

Hope that starts you off

Written in totality by Lewis Cameron of Stealth IT Solutions. Feel free to copy as much as you like but give me a bit of kudos if you paste this text anywhere else 
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 07-19-2005, 10:18 PM
Senior Member
0 posts this year. needs some grease!
New user, who has not interacted much yet.
 
Join Date: Aug 2004
Posts: 328
Thanks: 0
Thanked 0 Times in 0 Posts
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Default

yep love includes :P have many of them in the script im working on in my site (makes it neater for me)

btw: i do

include 'script.php';

instead of

include(`script.php);

difference matter?
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 07-20-2005, 03:43 PM
Senior Member
0 posts this year. needs some grease!
New user, who has not interacted much yet.
 
Join Date: Jul 2005
Posts: 247
Thanks: 0
Thanked 0 Times in 0 Posts
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Send a message via MSN to stealthhosts
Default

Quote:
Originally Posted by crowebird
yep love includes :P have many of them in the script im working on in my site (makes it neater for me)

btw: i do

include 'script.php';

instead of

include('script.php');

difference matter?
Makes no real difference I don't think, there is also require for php and include file/virtual for ASP
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
Reply

Bookmarks



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Webmaster Resources
UK WW SEO Tools
Find UK Hosts
 
The Forum Rules
Forum Rules - MUST READ
 
Site Of the Month
BizzFace
Nominate site of the month
 
Tag Cloud
43. wholesale adsense ready apple iphone 16gb apple iphone 16gb 3g articles article writer australia web hosting beauty cash casino cheap clothes communications content custard media database dgital camerals domain name english teacher fantasy football fantasy football league fittness football league free handbags home income instant jewelry links link sale medical health money money making online music natural health news nokia n96 16gb one way links online online shop poker professor quality links replica sam allcock seo social networking sony vaio laptop sunglasses technology the medical plus themes tutor verbalized wallet wallets wanted web hosting widget ready wordpress xmas offer

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reduce Spam registrations gkd_uk General Webmaster Talk 11 10-08-2007 08:01 PM
New OpenOffice version includes security upgrade rakib Computer and Software Forum 0 04-05-2007 04:14 AM
Reduce Price in Helloindex.com helloindex Directories 2 03-10-2007 06:19 PM
Algo update - Reduce Googlebomb Impact maxseo General Webmaster Talk 1 01-30-2007 10:43 AM
An excellent article on web standards, user centricity & Alexandru Ungur General Webmaster Talk 0 09-14-2004 04:42 PM


All times are GMT. The time now is 08:29 AM.

UK Webmaster World Forums - Internet marketing, web development, domain names, SEO contest and discussuons.
Subscribe to our feeds   Subscribe to our feeds

Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0