The book on PHP for 2002 as a source of knowledge is already history, I advise "PHP 5. Professional programming" - E. Gutmans, S. Bakken - ISBN: 5-93286-083-9, or even newer ...
Using an all-inclusive web server (Denwer and the hedgehog with it) - learn how to setup yourself, then you will have time to switch to semi-finished products
We use a simple editor with syntax highlighting - it's time to grow up and switch to IDE - development speed increases with IDE, especially in large projects with more than a dozen classes.
The register_globals parameter is enabled in php.ini - we disable this EVIL, it is disabled by default, but you need it for some reason
An implementation of “index.php” containing approximately the following code: <? Php require_once $ _GET ['mod']; ?> Is a vulnerability, called PHP injection - always check the input data.
The implementation of authorization, when the query string to the database contains something like: "SELECT * FROM users WHERE login =". $ _ GET ['login']. "AND password =". $ _ GET ['password'] - read what SQL is injection (this applies to all input data and SQL queries)
Do you trust POST variables more than GET? - Be sure to fake it as easily, so check
AJAX is good, leaky AJAX is bad - do not forget to check access rights for functions called in AJAX
We do not check the files uploaded by users - now we know what PHP Backdoor is
Assignment in the condition: <? Php if ($ auth = DEFINE_NAME) {...}?> You will search for such an error for a long time - try to avoid similar constructions (use the design <? Php if (DEFINE_NAME == $ auth) {...}?> - if you miss one “equal” character - the interpreter will generate an error)
“Cannot send session cookies - headers already sent by ...” - we are trying to set cookies, when the header has already been sent to the browser - have you left out a blank line or a space before the first tag <?
Rewriting PHP functions - use manual search
The expression <? Php if (array_search ('needle', $ array)! = FALSE) {...}?> - will not work if the required element is available by the key 0 or "" - read the manual for each function more attentively
We work under windows, hosting on linux and the site does not rise - the file name is index.php, Index.php, INDEX.php, etc. these are all different files for linux systems, and we forgot about it
Disabling error output - the code must be clean - so error_reporting (E_ALL) to help you, even Notic follow
Gulf project on hosting - disable error output on the screen - log them to a file - you will not blush later
PHP files have a non-standard extension (for example .inc instead of .php) - if you don’t protect such files, you can be very ashamed
In the calculation of short_tags, we were too lazy to write completely <? Php ...?> - now we rewrite templates on the new hosting
Hoped for magic_quotes, now our application is secure as Swiss ... cheese
Follow coding standards and write code comments - your followers will say thank you
Do not write mats in error messages and comments - the customer can view and then it will take a long time to make excuses
Read the article http://php.spb.ru/php/speed.html and think that the only way you can / need to optimize the code is “flea” optimization related to PHP3
Implementing database functionality with PHP tools - array_search instead of WHERE, and other wonders of not knowing SQL
We are knocking to the database in recursion - we try to bypass such implementations
No need to hammer nails with pasatizhs - “I need to implement a guest book — I’ll take my favorite set of 6 megabyte libraries”
We recognized Smarty, and now we are sure that we have learned how to separate logic and display.