|
|
How PHP Can Help Save You Time And Mistakes.(c)2004 by Ben ... a really simple way... to maintain and speed up yourweb site ... your web site grows, so does the problem of ... become more ... a two or thr (c)2004 by Ben Rourke 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 thatthis 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! Article Tags: //www Azzy Romot, //www Azzy, Azzy Romot Source: Free Articles from ArticlesFactory.com
ABOUT THE AUTHORBen Rourke.
Download Your FREE POP3 Mailbox Cleaner. Works Directly From Your Desktop. http://www.seazzypromotions.com/software |
||||||||||||||||||||||||||||||||||||||||||
Partners
|