Wednesday, November 12, 2014

Creating Php Pages Using php5

This Blog discusses the basics of PHP and starts you on your way to creating your first complete
Web site, one featuring movie reviews. After you complete your Web site, your visitors will
be able to locate information about a particular movie, and you will be able to program in PHP.

Even if you are familiar with PHP4, we encourage you to read through this chapter and to pay
particular attention to the section on Object Oriented Programming (OOP), which is a new feature
of PHP5.

This chapter covers the following basic PHP commands and structures:

1. Using echo to display text
2. Formatting text with both HTML and PHP
3. Constants and variables
4. Using a URL to pass variable values
5. Sessions and cookies
6 HTML forms
7. if/ else statemests
8. Includes
9. Functions
10. Arrays  and foreach
11. While and do/while
12. Using classes and method with OOP

By the end of this chapter, if you actually try all the "Try It Out" exerises, you will be able to create a simple login form, give your users an option to either see a review of your favorite movie or see a list of your top favorite movies, and offer them a numbered list of your movies based on how many they decide they want to see. You can even alphabetize the list for them, if so desired.

Overview of PHP Structure and Syntax

PHP programs are written using a text editor, such as Notepad or WordPad, just like HTML pages. Unlike HTML, though,PHP pages, for the most part, end in a .php extension. This extension signifies to the server that it needs to parse the PHP code before sending the resulting HTML code to the viewer's Web browser.
In a five-star restaurant, patrons see just a plate full of beautiful food served up just for them. They don's see where the food comes from, nor how it was prepared. In a similar fashion, PHP fits right into your HTML code and is invisible to the people visiting your site.

0 comments:

Post a Comment