Cheap web hosting - PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY What
Wednesday, October 17th, 2007PHP SOLUTIONS: DYNAMIC WEB DESIGN MADE EASY What this chapter covers: Understanding how PHP is structured Embedding PHP in a web page Storing data in variables and arrays Getting PHP to make decisions Looping through repetitive tasks Using functions for preset tasks Displaying PHP output Understanding PHP error messages If you re the sort of person who runs screaming at the sight of code, this is probably going to be the scariest chapter in the book, but it s an important one and I ve tried to make it as user-friendly as possible. The reason for putting the rules of PHP in one chapter is to make it easier for you to dip into other parts of the book and use just the bits that you want. If there s anything you don t understand, you can come back to the relevant part of this chapter to look up the details. That way, you can concentrate on what you need to know without having to wade through dozens of pages that aren t of immediate interest to you. With that in mind, I ve divided this chapter into two parts: the first section offers a quick overview of how PHP works and gives you the basic rules; the second section goes into more detail. Depending on your style of working, you can read just the first section and come back to the more detailed parts later, or you can read the chapter straight through. However, don t attempt to memorize everything at one sitting. The best way to learn anything is by doing it. Coming back to the second part of the chapter for a little information at a time is likely to be much more effective. If you re already familiar with PHP, you may just want to skim through the main headings to see what this chapter contains and brush up your knowledge on any aspects that you re a bit hazy about. PHP: The big picture When you load a PHP page into a browser, it looks no different from an ordinary web page. But before it reaches your browser, quite a lot goes on behind the scenes to generate the page s dynamic content. In most cases, this frenetic activity takes only a few microseconds, so you rarely notice any delay. At first glance, PHP code can look quite intimidating, but once you understand the basics, you ll discover that the structure is remarkably simple. If you have worked with any other computer language, such as JavaScript, ActionScript, or ASP, you ll find they have a lot in common. Every PHP page must have the following: The correct filename extension, usually .php Opening and closing PHP tags surrounding each block of PHP code
We would like to recommend you tested and proved virtual web hosting services, which you will surely find to be of great quality.