Skip to content

Lecture Notes - Week 1


  • Syllabus
  • Chapters:
    • Introduction
    • 1 - The Life and Times of a PHP Script
    • 2 - Writing Your First PHP Script (pgs. 15 - 19)

Screencast - Week 1

Outline of Topics


What is Open Source?

'Free software' is a matter of liberty, not price. To understand the concept, you should think of 'free' as in 'free speech,' not as in 'free beer.' - The Free Software Foundation

  • What is the difference between Open Source and Freeware?
    Freeware is software that is free to use but you do not have access to the source of that application. Open Source means you have the ability to view and modify the code of the application. Ideally an open source project will accept modifications from the community.

  • Is PHP Open Source?

Static vs. Dynamic Web Sites

  • A static web site is a page of content that is rendered the same every time it is requested.

  • A dynamic web site is one with content that is regenerated every time a user visits or reloads the site.

What is HTTP?

  • What does HTTP stand for?
    Hypertext Transfer Protocol

  • What does an HTTP Request look like?

http request response

What is PHP?

PHP is a popular general-purpose scripting language that is especially suited to web development. Fast, flexible and pragmatic, PHP powers everything from your blog to the most popular websites in the world. –

  • History of PHP

    • June 8, 1995 PHP 1.0 is posted to the usenet group comp.infosystems.www.authoring.cgi.

    • It was created by Rasmus Lerdorf as PHP Tools.

    • Then he set to work integrating his tools with the Apache web server and less than a year later, PHP 2.0 was posted to the same usenet group.

    • PHP originally stood for: Personal Home Pages.

    • PHP now stands for: PHP Hypertext Preprocessor (a recursive acronym).

    • It is most likely the fastest and simplest tool available for creating database-enabled web sites.

    • It will work with any UNIX-based web server on every UNIX flavor out there. The package is completely free of charge for all uses including commercial.

Here is how Rasmus described PHP at the time:

PHP/FI is a server-side HTML embedded scripting language. It has built-in access logging and access restriction features and also support for embedded SQL queries to mSQL and/or Postgres95 backend databases.

What does a PHP script look like?

<?php phpinfo(); ?>

PHP Functions

An independent piece of program code that is created to make programing easier.

Today is <?php echo date("m-d-Y"); ?>

The above code uses PHPs date function. The documentation can be found at


Here is PHP and HTML integrated together:

    <title>My Awesome Page</title>
      <h1>Today is <?php echo date("m-d-Y"); ?></h1>


  • The most popular open-source relational database

  • Here is what it looks like:

> SHOW databases;
> USE northwind;
> SHOW tables;
> SELECT * FROM test;
  • Why PHP & MySQL?

    • Both Open Source

    • Commonly used together

    • Both have a low barrier to entry


  • Apache Log

Getting Help

Week 1 Lab