Update Your Entire Website Instantly Using Server Side Includes



Get Web Design Tips and Tricks on mps-web-design.com. Update Your Entire Website Instantly Using Server Side Includes topic will increase your understanding on Web Design Tips and Tricks. We at mps-web-design.com only provide news, articles, information in Web Design Tips and Tricks. Web Design Tips and Tricks at mps-web-design.com provides the most up to date news and articles. If you have questions please do not hesitate to contact us.

Imagine my plight... I have 100+ pages on my website and I
have to change my e-mail address and the copyright info on
all the pages. The reason...

My mail box is over-flown with junk mails.

My only option is to edit all my web pages offline and then
upload each one of them again, not to mention countless
errors I make in the process.

100+ pages is still a small website. Imagine what it will be
like if my website had 1000+ pages?

Sounds scary right?

If you would like to avoid the kind of mess I'm in right
now, you have one option. Start using 'Server Side Includes
(SSI)'

In technical jargon, Server Side Includes are directives
which you can place into your HTML documents to execute
other programs or output such data as environment variables
and file statistics.

If your only intention is to manage your website more
effectively and painlessly, it is more than enough if you
learn one 'Directive' of SSI - the 'Include' directive.

In simple terms, SSI Include is a line of code which you can
use in your HTML documents to include contents from other
documents. In other words, change just one file (the
Include file), and your ENTIRE SITE is instantly updated!

The basic syntax of an Include directive is:



Where PATH_TO is the 'VIRTUAL' path to include file on your
server.

Here's how to include your copyright info and navigation
links using SSI Includes...

First, you need to check with your server administrator
whether your server supports SSI or not. Most servers
support them.

Second, you need to rename all your HTML files with
extension .shtml

-----SIDE BAR-----
You can start with one file and if everything goes fine,
rename rest of the files.
-----SIDE BAR-----

To keep things organized, you can create a directory at the
root level called 'includes' to house all of your included
files. Now create a HTML document with only your copyright
and navigation links. Copy everything that is between the
BODY tags of this document and paste it in a new file.

Save this file as nav.html or any name you like with
extension .htm or .html. You need not save this file with
.shtml extension. Now upload this file to your 'include'
directory which you created for housing SSI Includes.

To include copyright info and navigation links in a HTML
document in your SITE ROOT, place the following code where
you want the copyright info to be seen:



Now if you want to include copyright info and navigation
links in a HTML document in a folder UNDER your site root,
the code will change to:



...and so on.

If you want to change or edit your copyright info or
navigation links, just edit and upload your nav.html file
and the change will be reflected in all the documents (using
the 'Include code') instantly!

You can also create your website headers/footers using
SSI Includes.

There are host of other cool things you can do with SSI. For
more info on SSI, you can visit the following sites:

http://www.useforesite.com ut_ssi.shtml
http://wdvl.com/Authoring/SSI/Intro/index.html
http://www.bignosebird.com/ssi.shtml




Instant Article Submitter. - Amazing Breakthrough Software Stuffs Any Website You Want Full Of Free Targeted Traffic.
ForexEnterprise.com: Earn $1,000 Per Day. - The Multiple Streams of Income System - Start Making Money In Just 15 Minutes. Updated & Converting like Crazy!

Firing a function from your browser

The concept is as simple as firing a function from your browser, and it leans on PHP's call_user_func_array.

I'm going to outline the concept as I have implemented it. This exact implementation may not work in your case, but perhaps you can adapt it to do so.

if(isset($_GET['f']) && function_exists($_GET['f'])) {
$func = $_GET['f']; // Get function name.
unset($_GET['f']); // Drop function from from get.
// Fire and print function, passing 
// remaining GETs as function parameters.	
print_r(call_user_func_array($func, $_GET)); 
exit;
}

In our CMS/Framework, we set up a controller with the code from above to respond at a given URL, for example http://www.example.com/__FOO. By passing a function name as a GET variable, in this case 'f', and the parameters necessary for that function to work as subsequent GET parameters, the result of that function will be printed to the screen.

So, http://www.example.com/__FOO?f=hello_foo&a=world would fire the function hello_foo('world'), perhaps printing Hello World! to the screen.

This allows for a quick and dirty test of a given function, and can be done remotely on a live site, if necessary, without touching any files or whatnot.

We hide this behind an authorization wall and also clean our parameters before they get to this level, so if you try this, keep these points in mind.



Article Index: | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79


More Articles:


1. 10 Ways Web Site Text Can Impact Your Reader's Buying Decision By Ian Judge
10 Ways Web Site Text Can Impact Your Reader's Buying DecisionThe appearance of your web site text can actually increase or decrease your sales. The size, font, style and color of your text can easily affect your reader's buying decision. Below are ten points to consider when typing text on your web site.1. Easy To Read- You want to make it easy for your visitors to read your text. You don't want to use a light colored text like yellow on a white background and you don't want to use dark blue …

2. Product Review: FrontPage 2000
Several years ago (way back in 1994) I had to put together a heck of a lot of documentation to help me get my job done. I started with Microsoft Word, writing over a thousand pages in a couple of months. This was all documentation about how to manage our mainframe computer system and it's associated application programs.After a while, I decided it would be better to maintain this set of documents on an intranet instead of as printed manuals. Why? Well, I was so fast at writing and changing the t…

3. Planning a Web Site
Have you ever wondered why some web sites look like the marvelsof creativity and some look like specifically created to confoundvisitors? Ideally, no individuals make a web site toinconvenience their visitor but end up doing so because noserious thought is put into the planning face.Your web site on the Net is your virtual office - it representsyou on the Information Superhighway, where the traffic moves at alightening speed, and within a couple of seconds a particular website has to catch the f…

4. Review: Swish
Are you in a busy office and need to get web design jobs with complex text effects done immediately? Want to speed up your productivity but avoid working until Saturday afternoons breaking up text and hand tweening? Then, SWiSH, the new standalone tool that creates great font effects and more by David Mitchie, presented during the Flash Forward 2000 conference, is for you!. So what’s new with SWiSH? This tool enables you to create buttons and banners in the program itself. You can even create a …