PHP Web Development Program (new developer must read)

Source: Internet
Author: User
Tags lowercase php web development sql injection sql injection prevention
PHP Web Development Program (new developer must read)

Go to: http://www.phpchina.com/?action-viewnews-itemid-34880

List collection Print to friends Source: Phpchina Publisher: php.cn Heat 85 votes Browse 14,075 Times "Total 3 reviews" "I want to comment" time: September 18, 2009 11:30 Development Members

A) Project manager
b) Page Art
c) Page Development
d) Service-side program development
(e) System and data management
f) test and version control

Second,
Web site Group Development Concise process


III. Development tools and environment

A)
Server configuration
I.
WEB server: freebsd6.1+apache2.0+ PHP 5.0,svn version Control Service (test machine only).
II.
Database server: WIN2003 server+sqlServer 2000+mysql5.0,clustered server Cluster service, mail server.
Iii. 100m/1000m Switch
b) Development tools
I. Front Desk: Macromedia Flash 8.0, Macromedia Dreamweaver 8.0, Adobe photoshop CS
II. Backstage:
Zend Studio 5.2, SQL Server Enterprise Manager, phpMyAdmin

Four,
Technical Rules

A browser compatibility policy: Compatible with IE5.0 above version, and compatible with FireFOX2.0 above browser.
B Search Engine Optimization: Focus on Baidu, Google, Yahoo Search optimization, the production of clear and clear site map.
c) Character encoding rule: Chinese website rate adopts GB2312 character standard. [At present, I uniformly use the UTF-8 encoding to include the file contents of the database coding unified]
d) file and folder naming: for compatible Win32 with UNIX systems, a rate is named with lowercase letters.
(The name of a unified all-station folder and file is handled in lowercase format.) There's no problem. )
e) Common file naming rules:
I. Default home: Index.htm, index.html, index.php
II. The main
CSS file: style.css
III. Main JS file: main.js
IV. Main program configuration file: config.php
f) Common file directory unified naming
I. Photo catalogue:/images or/pic
II. CSS Style Catalog:/css
Iii. JS script directory:/js
IV.
template file directory:/TPL
V. Class or component directory:/class or/lib
g) page Scripting specification: Unified use of JavaScript
h)
the class in the code ,function , variable name: Unified use approximate English word name, such as: Defaultclass or Default_class
i) Code comment rule: the function or procedure in all programs must be annotated with an exact comment.
j) Database-related rules
I. Data tables and field naming rules: All lowercase letters are named and grouped with named prefixes such as: User table Group, User_passport, User_info, User_service ....
Ii. Date Type field: Unified use of Unix timestamp, char (12)
III. Primary keyword naming: All tables must establish a primary key named after the ID.
k) Template Component rules: Unified use of compatible version of the smarty, unified cache directory, to facilitate UNIX permissions under control.
(Set all writable files uniformly into a directory to make cache directory)
L) Database virtual layer: Unified use of ADODB or PDO,SQL statements to be compatible with existing mainstream database rules.
m) factory pattern development rules: developing or inheriting component classes with comm.php as the center, unified control file invocation Io and class instantiation.
N)
Object-oriented development rules: All functions must exist in the form of class---> procedures.
(Learn to encapsulate code into class form)
o SQL Encapsulation rule: All SQL statements and database queries must exist in the procedure.

p) URL steering rules: To optimize search engines, use as much as possible
Apache 's mod_rewrite module to beautify URLs, such as: Http://www.yourname.com/action.php?id=123 into: http://www.yourname.com /action/id/123 or http://www.yourname.com/action/id_123.html.


V. Website security and Maintenance strategy

A) server and database security:
I. Establish a sound virus defense mechanism, install a firewall, and shut down any unnecessary ports and services on the server.
II. Unified management of user rights, regular tracking of user and system events, periodic view of the system
Log .
B) Disaster recovery and backup mechanisms:
I. Establish a database cluster to keep at least one server synchronizing the data to ensure that the database system can be automatically transferred to the normal server for stable operation when the accident occurs.
Ii. regularly backs up files and data and saves data and files in a variety of ways.
C) Program security Policy:
I. SQL injection PREVENTION: resolutely filter the unpredictable illegal characters, strictly do the database query, update the SQL statement test.
Ii. do not use unknown third party source code, not easily copied to the server.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.