PHP stands for Hypertext Preprocessor. PHP is a server side, general-purpose scripting language which originally designed for web development. PHP code is embedded into HTML code to control the output of the web page.
What You Should Already Know
Before you continue you should have a basic understanding of the
following:
- HTML
- CSS
- JavaScript
How PHP code looks like?
Let’s take a look at a simple example of using PHP.
1
2
3
4
5
6
7
8
9
10
|
<html>
<head>
<title>Introduction to PHP</title>
</head>
<body>
<?php
echo 'Introduction to PHP';
?>
</body>
</html>
|
PHP code is embedded inside HTML document within the block that starts with <?php and ends with ?>. In the above example, we print out the “introduction to PHP” text in the web browser.
What is a PHP File?
- PHP files can contain text, HTML, CSS, JavaScript, and PHP code
- PHP code are executed on the server, and the result is returned to the browser as plain HTML
- PHP files have extension ".php".
How PHP Works?
The PHP resides in the server and processes PHP script. The processing flow is as follows:
- In the client side, user sends a HTTP request to the web server by invoking PHP web page the web browser.
- In the web server side, PHP executes the script, formats the output and sends generated page, which is in plain HTML format, back to the web browser.
- Web browser then display HTML document to the user.
What PHP can do?
- PHP can generate dynamic page content
- PHP can create, open, read, write, delete, and close files on the server
- PHP can collect form data
- PHP can send and receive cookies
- PHP can add, delete, modify data in your database
- PHP can restrict users to access some pages on your website
- PHP can encrypt data
With PHP you are not limited to output HTML. You can output
images, PDF files, and even Flash movies. You can also output
any text, such as XHTML and XML.
Why PHP?
- PHP runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.)
- PHP is compatible with almost all servers used today (Apache, IIS, etc.)
- PHP supports a wide range of databases
- PHP is free. Download it from the official PHP resource: www.php.net
- PHP is easy to learn and runs efficiently on the server side.
Please feel free To comment if you have any doubts regarding the article in comments below .
0 comments:
Post a Comment