Courses Available from LearnToProgram, Inc.
3D Fundamentals with iOS
Advanced Javascript Development
AJAX Development
Android Development for Beginners
Become a Certified Web Developer (Level 1)
Become a Certified Web Developer (Level 2)
C Programming for Beginners
C++ for Beginners
Construct 2 for Beginners
Creating a PHP Login Script
CSS Development (with CSS3!)
Design for Coders
Famu.os Javascript Framework
Game Development Fundamentals with Python
Game Development with Python
GitHub Fundamentals
HTML and CSS for Beginners (with HTML5)
HTML5 Mobile App Development with PhoneGap
Introduction to Web Development
iOS Development Code Camp
iOS Development for Beginners Featuring iOS6/7
Java Programming for Beginners
Javascript for Beginners
Joomla for Beginners
jQuery for Beginners
Mobile Game Development with iOS
Node.js for Beginners
Objective C for Beginners
Photoshop for Coders
PHP & MySQL for Beginners
Programming for Absolute Beginners
Project Management with Microsoft Project
Python for Beginners
Ruby on Rails for Beginners
SQL Database for Beginners
User Experience Design
Books from LearnToProgram, Inc.
Create Your Own MP3 Player with HTML5
CSS Development (with CSS3!)
Game Development with Python
HTML and CSS for Beginners
Javascript for Beginners
PHP and MySQL for Beginners
Programming for Absolute Beginners
Python for Beginners
SQL Database for Beginners
Swift Fundamentals: The Language of iOS Development
Chapter 1: Your First PHP Script
Chapter Objectives:
You will be able to define PHP and PHP scripting.
You will be able to identify and install the software development tools needed to create PHP scripts.
You will learn how to set up the programming environment needed to work with PHP.
You will be able to run your first PHP script.
1.1 Setting up Your Development Environment
You might think that when learning PHP programming, you would be studying the PHP language in isolation. However, PHP is central to a suite of technologies used to develop PHP-based applications. Describing the technologies in that suite is a good place to begin.
PHP is a general purpose, open-source, server side scripting language designed for web development. It is used to produce dynamic web pages. It is a web scripting language used to add basic web features to a site. Examples of PHPs use are creating username and password login screens, checking form details, creating forum pages, picture galleries, surveys and many more. PHP is a powerful language that enables developers to create almost any type of application that they desire.
Unlike some web languages such as Javascript, PHP is not executed within your web browser but instead on the serverthe computer that stores the page and makes it available to browsers on the internet. The server processes a request from a web browser and then returns the requested contentusually in HTML format. This is the reason that PHP is referred to as a server side language.
PHP can be written in both an external document or embedded within the HTML document itself. The PHP code is interpreted by a web server (frequently an Apache server) that has a PHP processor module, which generates the resulting webpage. Other popular languages similar to PHP are ASP, Python, Perl, and Ruby.
One of the frequent uses of computer languages like PHP is to interface with a database or data source. Frequently, PHP is paired with the MySQL database. Well talk about the interaction between PHP and MySQL towards the latter part of this book.
According to computer history, Rasmus Lerdorf developed the initial PHP specification. The term PHP is said to have evolved from his P ersonal H ome P age project into the open-source scripting language widely used and known today as Hypertext PreProcessora result of wide collaborative efforts by a pool of developers. However, it does not follow the original acronym PHP, thus, P re- H ypertext P rocessor. The scripting language itself was developed using the C language.
As Rasmus Lerdorf puts it, PHP is not a new and revolutionary language as it borrows much of its syntax from languages such as C, Perl and Java. PHP is a very focused web design language. It is a language written for web developers.