| Practical Uses of PHP | | | | hypertext on the server side. This generally means |
| It almost goes without saying that you will want your | | | | that when the PHP script (saved as a .php file) runs |
| business website to be compelling, interactive, and | | | | on your web server, it performs the programmed |
| secure. All of these characteristics will make your | | | | actions, and returns HTML code that will then be sent |
| website more effective at bringing in and keeping | | | | back to your customer's web browser. The PHP |
| customers. But how to go about it in a way that is | | | | script itself is not included in the HTML that is sent to |
| stable, cost-effective, and easy to manage? One | | | | the browser, so the PHP code is invisible and secure |
| popular solution is to use the server-side scripting | | | | to 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 "Personal | | | | syntax of PHP in action. Any detailed discussion of |
| Home Page", however it is now generally understood | | | | PHP code is beyond the scope of this article.) |
| to mean "PHP: Hypertext Preprocessor". It was | | | | In this statement, is the closing tag, and echo is a |
| originally designed to create dynamic or more | | | | PHP 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. PHP | | | | processes the PHP statement and outputs the |
| is a "high-level" language, meaning that it's generally | | | | following: |
| more human-friendly (and easier to learn) than other | | | | Hello 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 site | | | | the user's browser. The PHP statement itself is not |
| development, but rapidly grew to become a much | | | | delivered to the browser, so the user never sees |
| more robust language. PHP's primary use is as an | | | | any PHP statements. |
| "embedded" scripting language, which means that the | | | | Using PHP to Improve Your Website. |
| actual PHP code is embedded in HTML code. When | | | | PHP has many capabilities features designed |
| used in this way, PHP enables your web server to | | | | specifically for use in Web sites, including the |
| process web pages before they're displayed in the | | | | following: |
| user's web browser. | | | | 1. Securing Your Website. |
| Benefits of PHP | | | | PHP can be used to secure your website (or certain |
| PHP is popular because it can be embedded directly | | | | areas 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 and | | | | used 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 it | | | | 2. Working with Web Forms. |
| has a quick development time and can solve | | | | PHP can display an HTML form and process the |
| scenarios much quicker than some of the other web | | | | information 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 and | | | | by asking them to provide profile information, and to |
| mature language used for web programming much | | | | collect 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 scripts | | | | databases, and storing information from the user or |
| which allow your Web site to interact with a | | | | retrieving information that is displayed to the user. |
| database. | | | | PHP handles connecting to the database and |
| Cross-Platform: Both the PHP engine and the PHP | | | | communicating with it, so it's not necessary to know |
| code can be used on almost any platform, making it | | | | all 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 to | | | | the name of the database and where it is, and PHP |
| work on PHP; you do not need any development | | | | handles 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 code | | | | You 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-line | | | | further help you to build customer loyalty, including |
| scripting and client-side GUI applications. PHP is an | | | | interactive polls, a guestbook, and a message board. |
| extremely versatile language which enables you to | | | | The popularity of PHP continues to grow rapidly |
| create high-end, stable Web sites with plenty of bells | | | | because it has many advantages over other technical |
| and whistles. Here are just a few of the things you | | | | solutions. 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 Forms | | | | page is relatively short), PHP is free (it is open-source |
| Store Information in Databases | | | | software), 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 Arrays | | | | OS, 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 large | | | | well-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 using | | | | of 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. |