The Most Useful PHP Script

November 11, 2008 · Posted in Code and Scripting, News 

Domains $7.49 - Why Pay More?I’ve been blogging for over a year now, and it occured to me today that I hardly have any articles or posts regarding web development tips and tricks. So I’ve added a new category and will begin filling it out with posts. But on to my topic.

Many new webmasters begin their personal development by learning html. HTML is great for building static webpages, however it has many limitations that make it difficult to conveniently administer a hand coded website without using a server side scripting language such as PHP or ASP. When I began learning ASP I was taught about include files and how a single line of code can save you hours of work coding and recoding the same code across your website.

Include files are the best way to jump into PHP or ASP, they’re very simple to emplement if you’re web server already has PHP or ASP scripting. In PHP you simply place the following line of code at the top of your page.

<? include(‘header.php’) ?>

This will include the file header.php that is in the same directory as the page you are attaching the file to.

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

Comments

2 Responses to “The Most Useful PHP Script”

  1. fijiwebdesign on February 3rd, 2009 12:27 am

    Good to note is that you can also include HTML files through PHP. The HTML file will be treated as a PHP file, but it can contain just HTML.

    eg:

    It is also a good practice (for portability) to use the full PHP tags instead of short open tags. Short open tags is turned off by default in the later PHP releases as interferes with XML documents embedded in PHP.

    ie: XML documents begin with <?xml and is mistaken for the beginning of a PHP block and thus creates a parse error.

  2. fijiwebdesign on February 3rd, 2009 12:28 am

    The example of including HTML was:

    <? include(’header.html’) ?>

    Gabe – http://www.fijiwebdesign.com

Leave a Reply

You must be logged in to post a comment.

  • Random Quote

    “Failure is success if we learn from it.”
    by Malcolm Forbes
  • Categories


RocketScience Network | Detroit Project | Rainfora | 420 Pets | Web Design Ninjas | The New Virus | Kreative Kubits | Host Militia