1.1. This course
This Online Course is designed to introduce you to PHP and MySQL. You will be guided through the installation and some examples. After this course you will have an idea of what PHP is and you will be able to create simple PHP pages. If you are interested then it is definitely worthwhile to follow a training course led by an experienced trainer.
1.1.1. Insider information
In order to take this Online Course you must be familiar with HTML. It is also nice if you know what a server is. Programming experience is not necessary.
1.1.2. Coherence with other courses
PHP, as we use it here, depends very much on HTML. You can follow a Learnit TRAINING HTML to get familiar with it. If you want to continue working with PHP, you can Learnit a PHP basic course Or a php follow-up course .
You can just go through this course chapter for chapter and create the commands. It is assumed that you have installed the software as described below, and that you have always read the preceding chapters. In addition, screen shots are regularly used, due to differences in the operating system and other software packages, these may differ from what you see on your screen. Do not attach too much value to this!
1.2. What is PHP
In 1994, Rasmus Lerdorf of IBM developed the scripting language PHP which was Then for personal Home Page. Since PHP version 3.0 in 1998 it stands for pHP Hypertext preprocessor. This is what it does: Edit hypertext (HTML). A scripting language is a high-level programming language that is designed to easily develop software. This language is particularly suitable for the development of Dynamic Web pages.
1.2.1. Dynamic pages
Web pages are originally simple HTML files that are on a server waiting for a visitor to request them to view them. These types of pages are also called static . Other hand are dynamic pages. These are web pages that are only generated when they are requested by a visitor requesting a page from a server. The nice thing about this is that the page can change time and time again, depending on the time, visitor or a completed Web form.
There are several techniques for creating dynamic pages. Common methods are nowadays ASP (ACtive Server PAges) of Microsoft and PHP, which we discuss here.
1.2.2. PHP and HTML
In The above story you came across the term HTML (Hypertext Markup Language) on a regular basis. If you don't know what HTML is, it will be difficult to follow the rest of this course and it is advisable to follow a TRAINING HTML first.
PHP and HTML are actually an inevitable tandem. Practically everything you generate with PHP is HTML; We use PHP to generate an HTML file automatically, and at the time that there is demand for it. A visitor to the website surfs to a. php file, the PHP interpreter on the Web server goes to work, creates HTML and sends it back to the browser that displays it as if it were a normal HTML page. In Chapter 2 We start with a simple example that will illustrate this.
1.2.3. PHP and MySQL
MySQL is an open source database and, although it can also be used with other databases, it is usually the storage mechanism behind a dynamic WEB page developed with PHP. The database keeps all the information, and PHP makes sure that this data can be modified and displayed as a Web page. In This course we will handle some applications that use MySQL.
The interconnection of HTML, PHP and MySQL can be displayed as follows:
A client, in this example, the Firefoxweb browser, requests a page from the server. The PHP interpreter sends a SQL (Structured Query Language) query to the MySQL database. This executes the query and sends the resulting data back to the PHP interpreter that generates HTML around it. This HTML is sent back to the client. If the above is still a bit puzzling for you, this is not a reason to drop, in the subsequent chapters all this is still covered!
1.3. Dowloading and installing
As mentioned earlier, PHP is only a scripting language, and it is not possible to download or install a scripting language. So we can't speak of "installing PHP", so we can install a so-called interpreter . In This course we use PHP to generate dynamic Web pages. We also want to install a Web server that CAN interpret PHP.
We assume that you are using a version of MS Windows if you use operating system, though this is not necessary to follow this course.
PHP is practically always used in combination with the Web server Apache and the database server MySQL. The simplest way to install a good working server is to download the XAMPP package. The XAMPP package is particularly suitable for the development and testing of your own computer. In addition to the Apache Webserser and the MySQL database server, the package contains some frequently used additions. Here you can download the installer. It does not matter which version of XAMPP you use for this course.
After downloading, open the installer, and follow the instructions on the screen.
Note: Remember where you install XAMPP!
After installation, the question is asked if you want to start the "XAMPP control Panny", answer "yes". With the Xampp Control Panel you can start and stop the Apache webserver Mysql database. For the course it is important that both are started.
To check if this has gone well, surf to http://localhost. If everything went well, your screen will look something like:
If this is not the case, first verify that you have not already installed a server (for example, IIS) and disable it.
Also Skype can be the culprit. It is important to quit Skype completely for the webs to start. If it still doesn't work then you can read the FAQs ON the XAMPP website.
Besides XAMPP there are other packages from which you can choose, but in this course we assume that you have XAMPP installed.