How hard it is to use and learn PHP
PHPis not a sophisticated technology, but at the same time, you do not expect to be able to5become an expert within minutes. For beginners, the biggest non-adaptation may bePHPis more tolerant than the browserHTMLa much lower degree of fault tolerance. In theHTMLIf an end tag is omitted, most browsers will still display the page. In thePHP, If you omit an end Quote, semicolon, or curly brace, it will look like the figure1-3get an error message as shown. It's not justPHPa feature of all server-side technologies, includingASP,ASPand theColdFusion.
?
Figure 1-3 like PHP This server-side language is not tolerant of most coding errors
If you are using a visual design tool (such asAdobe DreamweaverorMicrosoft Expression WebWeb Designer or developer, and never pay attention to the underlying code, then it's time to rethink your approach. Will bePHPand The poor structure of the HTMLmixing together has the potential to cause some problems. PHPuse loops to perform repetitive tasks, such as displaying the results of a database search. ALoops(Loop) repeats the same piece of code (the code usually contains bothPHPand theHTML) until all results are displayed. If you put the loop in the wrong place, orHTMLstructure is poor, the page may collapse like a house of cards. If you are not accustomed to doing so, use the(World Wide Web Consortium)of theMarkup Validation Service(Http://validator.w3.org/unicorn) to check your page is a good idea.
the is an international organization that is responsible for setting standards (e.g. HTML and the CSS ), and make sure Web guidelines for long-term development. It was led by Tim Berners-lee , creator of the World Wide Web . To understand The mission, see www.org/Consortium/mission.
?? is it possible to copy and paste only the code
?
There is nothing wrong with copying the code in this book, which is exactly what they exist for. Replication is a method we have learned as a child, but most of us will be free from the stage of imitation, and we will ask questions and start experimenting on our own. I'm not going to teach you to learn PHP with tedious exercises that don't have direct value to the Web , and this book is meant to allow you to directly apply the new knowledge to the actual project. At the same time, I'll explain what the code is for and why it's there. Even if you don't understand exactly how it works, you'll get enough knowledge to understand which part of the code fits your needs and which part is best to ignore.
PHP is a toolkit that provides a lot of powerful functionality. It has thousands of built-in functions that can perform a variety of tasks, such as converting text to uppercase, generating thumbnails from full-sized images, or connecting to a database. The real power is to combine these functions in different ways and add them into your own conditional logic. To learn more from this book, you need to experiment with the tools you learned in the book and present your own solutions.
Security for PHP
1 edition is one of the inspirations from the 2005 after
The moral of this story is not PHP is not safe, nor is it that everyone needs to be used PHP security experts. It is important to understand The Basic principles of PHP Security: It must be checked before processing user input . You will find that this will become a theme throughout the book. With little effort, most security risks can be eliminated.
The most worrying aspect may be that after more than five years of this problem being revealed, I still see many people using unsafe mail scripts. The best way to protect yourself is to understand the code you're using. Even if you can't solve the problem yourself, you can implement remedial actions that are recommended by script writers or other experts. ?
--Excerpt from the PHP Dynamic Web Design (2nd edition)