Skip to content

Beginning PHP Programming

So you would like to learn PHP, the popular scripting language used to run countless websites?

What Is PHP?

When PHP first came out it originally stood for Personal Home Page. Over 10 years ago, 1994 to be exact, a man named Ramus Lerdorf created PHP to track visitors who viewed his online resume. As time progressed and PHP's features were expanded on, it got a new name: PHP: Hypertext Preprocessor.

PHP allows you to embed PHP code directly into HTML web pages. HTML is the markup language web pages use to display content to the user. PHP is a scripting language and not a programming language.

PHP is also a server-side technology. What this means is that PHP handles all tasks on the server and outputs as HTML. A web visitor would not be able to tell if the web page was written in PHP since all the code the web browser has is HTML. The opposite to servier-side is client-side technology. All those nifty mouseovers, browser-resizing, etc... features are handled on the users browser (i.e the client) via JavaScript. The nice thing about PHP is you can send JavaScript code to the browser all while using PHP.

Another benefit of PHP is that it is cross-platform. Meaning it runs on all sorts of operating systems. PHP can work with Linux, Windows, Mac OSX, any BSD variant, Solaris, etc... Again, we are talking about the server's operating system, not the client's. This means you don't have to worry about whether or not the user has "X" feature enabled on their browser. All the code is interpreted before the user has a chance to see it.

 

Markup, Scripting and Programming Languages

The differences between these three types of languages are:

  • A markup language only changes how text is displayed to the user. You can think of it as a "theming language". It's sole job is to tell the web browser "make all links blue" or "make all bullet points square and color them red".
  • A scripting language is a computer language that gets "intercepted" by another program and gets interpreted on the fly. PHP code is sent to the PHP preprocessor and the preprocessor translates everything on the fly. The output is then sent to the web browser as HTML.
  • A programming language is a compiled language. It takes all the code that the developer has created, translates it into machine readable code (i.e binary code) and creates a full, self-sufficient program. Well coded compiled programs outperform scripts created with a scripting language.

Why Use PHP?

There are countless reasons to use PHP, although a few popular reasons are:

  • PHP is open-source software meaning it is free (as in freedom, not beer)
  • PHP was specifically designed to create dynamic web pages.
  • Other web scripting languages (i.e ASP.NET) require knowledge of other programming languages like C# or VBScript.
  • PHP has an active community surrounding it. So if you need help, there is help available.

Assumptions

This guide makes a few basic assumptions about the knowledge of the reader.

  1. You should have a basic understanding of (X)HTML and Cascading Style Sheets (CSS).
  2. You know how to install software and configure software text files.
  3. You can connect and upload files with a FTP client.

So let's get started shall we?

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <p><b><i><pre><a><img><em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd><h1><h2><h3><h4><h5><h6>
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

More information about formatting options