Basics of Php

Practical Uses of PHPhypertext on the server side. This generally means
It almost goes without saying that you will want yourthat when the PHP script (saved as a .php file) runs
business website to be compelling, interactive, andon your web server, it performs the programmed
secure. All of these characteristics will make youractions, and returns HTML code that will then be sent
website more effective at bringing in and keepingback to your customer's web browser. The PHP
customers. But how to go about it in a way that isscript itself is not included in the HTML that is sent to
stable, cost-effective, and easy to manage? Onethe browser, so the PHP code is invisible and secure
popular solution is to use the server-side scriptingto the user.
language PHP to help you solve those problems.For example, let's consider the following simple PHP
What is PHP?statement. (This example is merely to show the basic
Created in 1995, PHP originally stood for "Personalsyntax of PHP in action. Any detailed discussion of
Home Page", however it is now generally understoodPHP code is beyond the scope of this article.)
to mean "PHP: Hypertext Preprocessor". It wasIn this statement, is the closing tag, and echo is a
originally designed to create dynamic or morePHP instruction that tells PHP to output the text that
interactive web pages. It is a widely-used,follows it as plain HTML code. The PHP software
open-source, general-purpose scripting language. PHPprocesses the PHP statement and outputs the
is a "high-level" language, meaning that it's generallyfollowing:
more human-friendly (and easier to learn) than otherHello World
programming languages such as C, ASP or ASP.net.This is a regular HTML statement that is delivered to
PHP was originally designed for use in Web sitethe user's browser. The PHP statement itself is not
development, but rapidly grew to become a muchdelivered to the browser, so the user never sees
more robust language. PHP's primary use is as anany PHP statements.
"embedded" scripting language, which means that theUsing PHP to Improve Your Website.
actual PHP code is embedded in HTML code. WhenPHP has many capabilities features designed
used in this way, PHP enables your web server tospecifically for use in Web sites, including the
process web pages before they're displayed in thefollowing:
user's web browser.1. Securing Your Website.
Benefits of PHPPHP can be used to secure your website (or certain
PHP is popular because it can be embedded directlyareas of your website) so that your customer must
into HTML coding.enter a valid username and password. This can be
PHP can be used on all major operating systems andused to reward preferred customers and to build an
is supported on most web servers.exclusive "membership" component of your business.
PHP's main focus is development for the web, so it2. Working with Web Forms.
has a quick development time and can solvePHP can display an HTML form and process the
scenarios much quicker than some of the other webinformation that the user types in. This can be an
design languages.excellent way to learn more about your customers
The latest version of PHP is a very stable andby asking them to provide profile information, and to
mature language used for web programming muchcollect information about their specific interests.
like Java and Microsoft C#.3. Communicate with Your Databases.
It is open source so it is free!PHP is particularly adept at interacting with your
Database: It is very easy to write simple scriptsdatabases, and storing information from the user or
which allow your Web site to interact with aretrieving information that is displayed to the user.
database.PHP handles connecting to the database and
Cross-Platform: Both the PHP engine and the PHPcommunicating with it, so it's not necessary to know
code can be used on almost any platform, making itall of the technical details for connecting to or
extremely versatile.exchanging messages with the database. You tell PHP
Development Tools: You only need a text editor tothe name of the database and where it is, and PHP
work on PHP; you do not need any developmenthandles the details. All major databases are currently
environment or compilers.supported by PHP.
What can you do with PHP?4. Customer Loyalty Functions.
PHP generally runs on a web server, taking PHP codeYou can also use PHP to create a number of
as its input and creating Web pages as output,different functionalities on your website that will
however you can also use it for command-linefurther help you to build customer loyalty, including
scripting and client-side GUI applications. PHP is aninteractive polls, a guestbook, and a message board.
extremely versatile language which enables you toThe popularity of PHP continues to grow rapidly
create high-end, stable Web sites with plenty of bellsbecause it has many advantages over other technical
and whistles. Here are just a few of the things yousolutions. PHP is fast (because it's embedded in the
can do with PHP:HTML code, the time to process and load a Web
Make HTML Web Formspage is relatively short), PHP is free (it is open-source
Store Information in Databasessoftware), and PHP is versatile (is runs on a wide
Remember Web site visitors (cookies and sessions)variety of operating systems, including Windows, Mac
Work with ArraysOS, Linux, and most Unix variants).
Work with Files (File Management and downloads)Perhaps most importantly, PHP is a very
Parsing and Generating XML (also useful for largewell-established language. There are many user-run
quantities of products on e-commerce)Internet communities that make very large amounts
Check which browser your visitor is usingof information (and scripts) available. With so much
How does PHP Work?experience behind it, using PHP for certain dynamic
As its name ("PHP: Hypertext Preprocessor")features can be a cost-effective and low-hassle way
suggests, PHP derives its power by "preprocessing"of increasing the stability of your website.