PHP Tutorials

Introduction & installation

Introduction about PHP & installation

Introduction to PHP

This Tutorial is basically a general introduction to PHP. This includes:

What is PHP?

          PHP has become a more popular technology for web programming in the recent years due to its open source technology. This means that it is free to use and is compatible with almost any server, say Windows, Linux/Unix and Apache servers. Though it is an open source technology, it has many advanced features included in it and is now capable of handling almost any issue related to the internet.

PHP stands for "PHP Hypertext Preprocessor". PHP is a server-side scripting language. This means that a PHP page is processed on a Web server by a PHP script engine. When the client makes a request for any page, the request is sent to the server, the server locates the requested page and executes the PHP code if any and the result is sent to the browser (client) in the form of HTML. The browser then compiles the HTML to display the output.

Now lets start with the basics of PHP programming. PHP code is written within <?php ... ?>. To understand better, lets look at the following example:

<html>
<head>
<title>SmartWebby's PHP Tutorials</title>
</head>
<body>
<?php
echo "Welcome to SmartWebby's Guide to PHP Programming"
?>
</body>
</html>

Save the above code as 'sample.php'. In the above example we have used PHP to display the message "Welcome to SmartWebby's Guide to PHP Programming". Once the client requests this sample webpage, it just displays "Welcome to SmartWebby's Guide to PHP Programming". Now if you view the source code from your browser, it will contain only the HTML code as shown below:

<html>
<head>
<title>SmartWebby's PHP Tutorials</title>
</head>
<body>
Welcome to SmartWebby's Guide to PHP Programming
</body>
</html>

Thus it proves that PHP scripts are processed only by the server and not by the client (browser).

PHP installation

          PHP installation files can be downloaded from various sites as zip files and installed onto your system. The most popular sites are www.zend.com, www.phpbuilder.com, www.php.net. Just click on these sites and they will guide you how to download the files related to your server. You will have to save them onto your system hard drives and run PHP. That's all and now you can run programs written in PHP.  

How to install MYSQL database and PHPMyAdmin

          The most popular database for PHP is MySQl which is again free to use. Similar to PHP files, MySQL database can be downloaded from www.mysql.com. There are two ways in which the user can handle the database related functionalities, either by using the MS-DOS or by writting DOS commands to create database and tables. The user friendly interface for MySQL is provided in the site www.phpmyadmin.net. You can download the files from this site and follow the instructions to run the interface. Once this is done it is the most easiest way to handle the MySQL database.

Now you are set to write applications in PHP/MySQL.

Please like, +1, link to and share this SmartWebby resource if you found it helpful. Thanks!