Free content for your website, newsletters or ezines. Free articles for reprint | Lbry.com
corner Set as Homepage   |   Add to Favourites corner
 
Search for
Need more search features? Go to Advanced Search
 
 
Article Categories
Advertising
Direct Mail, PPC, Word of Mouth
Advice
Affiliate Programs
MLM
Arts
Auto & Trucks
Auto Leasing, Diesel vs. Gasoline Vehicles
Awards
Beauty, Personal Care & Grooming
Business & Finance
Finance, Management, Marketing, Sales
Careers
Communications
Computers & Internet
CD Duplication, Computers FAQs
Copywriting
EBooks
ECommerce
Education
Email
Entertainment
Environment
Family
Child Care
Food & Drink
Cooking & Recipes
Free
Furniture
Office Chairs
Gadgets & Gizmos
Games
Gardening
Gifts
Government
Health
Hair Loss, Headaches, Healthy Eating, Natural Cures
History
Hobbies
Boat Acquisition
Home Business
Home Improvement
Humour
Internet
Blogs, CGI, CSS, DHTML, HTML, Javascript, RSS
Kids and Teens
Law
Marriage
Men's Issues
Metaphysical
Motivational
Music & Movies
Newsletters
Online Business
Organization & Time Management
Parenting
Personal Security & Wellness
Credit Repair, Life Insurance
Pets & Animals
Cats, Dogs
Politics & Government
Press Releases
Psychology
Publishing
Real Estate
Home Mortgage
Recreation & Sports
Fitness, Mountain Biking, Tennis
Reference
Relationships
Religion & Faith
Scams
Science
Weather
Search Engines
Link Popularity, SE Optimization, SE Positioning, SE Tactics, Sitemaps
Self Help
Sexuality
Shopping
Signs & Astrology
Society
Work Life
Technology
Bluetooth, Podcasting
Travel & Adventure
Beach Vacations, Ski Vacations
True Life Stories
Websites
Domain Names, Site Promotion, Web Development, Web Hosting
Weight Loss
Women's Issues
Writing
 
 »  Home  »  Internet  »  HTML  »  How PHP Can Help Save You Time And Mistakes.
How PHP Can Help Save You Time And Mistakes.
By Ben  | Published  11/28/2005 | HTML | Unrated
How PHP Can Help Save You Time And Mistakes.
Ben
Ben Rourke. Download Your FREE POP3 Mailbox Cleaner. Works Directly From Your Desktop. http://www.seazzypromotions.com/software 

View all articles by Ben


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:

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



Place your content here.



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

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

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:


include 'template/header.php';
?>

You must always include the opening tag: 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:

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!
Note: Republishing this article is permitted in the following conditions:
 
author by-lines are kept intact and unchanged. Hyperlinks and/or URLs provided by authors must remain active.
 
 
a link to the Lbry.com site is required in the use of articles either as print or an active url on the articles web page as below:
[ Article from Lbry.com ]
How would you rate the quality of this article?
1 2 3 4 5
Poor Excellent
Tell us why you rated this way (optional):

Send to Author Post on Site

 
Comments


Article Options
Most popular articles

»

Dementia: Will I Get It?

By N/A | Published 12/31/1969 | Health | Rating:
In the article Dementia: Just What Is It, we have learned about a frightening term, Dementia, and just what it is or, rather, how it manifests itself in the human condition. I gave 5 examples from my personal knowledge, including myself.
 
  Read the full article   Print this article  
Report An Error    

»

Triumphing Over Tantrums

By N/A | Published 12/31/1969 | Family | Rating:
Patty Hone
 
  Read the full article   Print this article  
Report An Error    

»

Checked Into Nirvana. Where Is Joy?

By N/A | Published 12/31/1969 | Metaphysical | Rating:
Eckhart Tolle lived upto his twenty ninth year in a state of almost continual anxiety interspersed with periods of suicidal depression. Then he woke up one night with a feeling of absolute dread. The silence of the night, the vague outlines of the furniture in the dark room, the distant noise of a passing train - everything felt so alien, so hostile, and so utterly meaningless that it created in him a deep loathing of the world. "I cannot live with myself any longer." This was the thought that kept repeating itself in his mind. Suddenly he became aware that if he could not live with himself, there had to be two - he and the "self" he could not live with. He was stunned by the realization. He became enveloped by powerful feelings.
 
  Read the full article   Print this article  
Report An Error    

»

Celebrex Law Suits Looking Like a Strong Case

By N/A | Published 12/31/1969 | Law | Rating:
There is no data as yet that indicates how many former patients of Pfizer's anti-inflammatory and painkilling drug are filing Celebrex law suits, but given the magnitude of the company's perceived crime it is likely that there will be very many. And even a quick perusal of the alleged behaviour of the company regarding this drug seems to point to Celebrex law suits being something of a fait accompli.
 
  Read the full article   Print this article  
Report An Error    
No popular articles found.
 
Become an Author
 
Are you a writer and you want your work published?
 
 
Do you have a website and need free publicity?
 
 
Sign up for free as a Lbry.com author and have your articles published in no time!
Click here to become an author
 
Advertising
 
 
 
 
Lbry.com Sponsors