Your Ad Here

 Navigation

Home
Source code
Tutorials
RSS feeds
Articles
Books
Software
Downloads
Hosting
manuals
Forums
Script directory
Training
Our Links

 Sponsors
 Links
gambling sites
programmershelp
wwwstores
 Downloads
 Misc

Webmaster Resources
Only PHP
ScriptSearch.com
Scripts.com - Get the best scripts NOW!
AndreaPHP Programming



How PHP Can Help Save You Time And Mistakes.


(c)2004 by Ben Rourke

Here's a really simple way... to maintain and speed up your
web site development.

As your web site grows, so does the problem of maintaining
it become more complex.
Even a two or three page site can have a lot of detail in
it. If you want to make any changes to the links or content
you have to do so for each page on the site, and then upload
all the new information.
All this can be very time consuming and also create the
possibility of errors creeping in, which can make your site
look less professional.
This is where PHP can come to your assistance. I am not
going to go into an explanation of PHP here, there are lots
of sites online where you can find out more detail about it,
if you wish to get more involved.
Here, I am going to show some simple techniques to help you
with your web site creation and maintenance, thus saving you
lots of time and reducing the risk of errors.

Step 1:
How to change information across a complete site easily
using PHP.

Say you have a list of links across the top of your page and
you want to maintain these links over a 20 page site.
If you were to change one of those links, you would manually
have to do it for the remaining 19 pages also.
As you can appreciate this would be a time consuming process
making the changes and uploading each page seperately. Also
the potential to make a mistake is very great indeed.

However using the method outlined below, you will be able to
update complete sites in no time at all, virtually reducing
the possibility of making mistakes to zero.

The trick is to use PHP to 'include' a header and a footer
template called from your main file 'index.php'

Don't worry if this does not make sense at present as all
will be explained shortly.

Here is an example of a index.php file:

==========================================================
<?php
include 'template/header.php';
?>

Place your content here.


width="230"
height="65" alt="">

<?php
include 'template/footer.php';
?>

==========================================================

Point your browser to
http://www.seazzypromotions.com/example to see it in
action.
View the source on that web page and notice all the HTML.
Where did all that come from you ask? All will be revealed
now, and then you are well on your way to easily generating
and maintaining your sites with ease.

Notice the first segment:

<?php

include 'template/header.php';
?>

You must always include the opening tag: <?php and the
ending tag: ?>
In between them we have an instruction to 'include' a file
called 'header.php' which is located in a folder on your web
site called 'template'. Obviously these can be renamed to
anything you like.

Now for the second segment:

<?php
include 'template/footer.php';
?>

Again, we have given an instruction to 'include' a file
called 'footer.php' which is also located in a folder called
'template' on your web site, in the same directory or folder
as your 'index.php' file.

To see these files individually go to:
http://www.seazzypromotions.com/example/template/header.php
and
http://www.seazzypromotions.com/example/template/footer.php

and view the source code on those pages using your web
browser.

Now you can add content to your web pages by inserting or
copying and pasting existing code between the PHP segments
of your 'index.php' file as shown above.

That is it!
To change any information in the 'header.php' for example,
just open that file in an editor and make your changes.
Then save and upload 'header.php' to the 'template' folder
on your web site.

Go to 'index.php' and all your changes are magically
included. You can see the benefits of this. If you had a
site with 20 pages, all your changes happen on every page by
just editing this one 'header.php' file.

Just 'include' the header and footer files into every other
page you make as in the 'index.php' file, calling your
second page for example 'products.php', then 'contact.php'
etc. The only thing different between all the pages will be
the content you insert between the header and footer
sections.

------------------------------------------------------------

So, if you have put off learning PHP until now, I hope that
this has encouraged you to make a start.
There are countless other ways to use PHP and maybe one day
you could even program your own safelist script using it.

Use the source from the examples and make changes to the
'header.php' and 'footer.php' files and see this in action
for yourself.

Above all have fun!

About the Author

------------------------------------------------------------
Ben Rourke.
Download Your FREE POP3 Mailbox Cleaner.
Works Directly From Your Desktop.
http://www.seazzypromotions.com/software
------------------------------------------------------------

Written by: Ben Rourke

 



Here is our complete list of articles


Apache MySQL and PHP for Windows

Apache MySQL PHP for Windows

ASP CGI and PHP Scripts and Record Locking What Every Webmaster Needs To Know

Autoresponders With PHP

Bring Your Web Site to Life With PHP

Clickbank Security Using PHP

Create a Simple Effective PHP Form for Your Web Site

Creating Dynamic Website Content with PHP MySQL

Developing a Login System with PHP and MySQL

Developing State enabled Applications With PHP

For Automated Sites PHP and MySQL are A Perfect Match

Get PHP pages indexed in the Search engines

Getting your Visitors Details Using PHP

How to make a simple form mailer with PHP

HTACCESS Wrappers with PHP

Maguma has integrated support for the eBay Acellerator Toolkit for PHP PHP AT in their PHP IDE Maguma Workbench

Make a Search Engine For Your Website With PHP

Mastering Regular Expressions in PHP

More Autoresponders With PHP

MySQL Database Handling in PHP

ONLINE the eBay Accelerator Toolkit for PHP PHP AT for the PHP IDE Maguma Workbench is available

Password Protection and File Inclusion With PHP

Password Protection with PHP MySQL and Session Variables

PHP Account Activation

PHP and Cookies a Good Mix

PHP Auto surf Websites

PHP Databases

PHP Dynamic Content

PHP Email

PHP Encryption

PHP Error Pages

PHP Files

PHP Form Series Part 1 Validators Client side Validation

PHP General Scripting

PHP Image Gallery

PHP in the Command Line

PHP is 10 years old

PHP my favorite Server side Programming Technology

PHP On The Fly

PHP Pear Packages Why they are so important to php developers

PHP Redirect

PHP Scripts Dont Have to End in PHP

PHP Server to Client with No Refresh

PHP Sessions / Cookies

PHP Templates

PHP User Login Authentication

PIM Team Case Study Creating Text Effects With PHP and GD

Protecting your HTML and PHP Source Code

Quick Intro to PHP Development

Serialize this Saving Objects in PHP

Simple Solution for Php Includes IFrames

Site Personalization With PHP

Some PHP functions you must know

Track Your Visitors Using PHP

Victoryvisions The PHP/Mysql Company Complete website development company



Books
 Sponsors
 Random Code
The Register news(xml)

PHP and cURL example(internet)

yahoo science feed(xml)

 Random Article
  Network

Programming resources
Tutorials directory
General bid directory
sell software, make money
Find me wholesalers
Find me dropshippers
Free recipes online/a>
UK products and price comparison
Anime videos
Free lyrics search
free stuff
UK stores
Gambling directory
Sexy free wallpapers
Hosting resources
ASP site
Golf resources
iPod resources
Coupons and deals
Baby names
Domain names
Dating site
Scripts directory
Maxi directory
bigarticle : free articles
dawgwitch search
List of directories






beginners PHP Copyright © 2004 onwards by beginnersPHP.