Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the various problems and points for attention of the PHP project?

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

What are the various problems and matters needing attention of the PHP project? many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can get something.

After working on php for three years, I have also done several projects, and I feel a lot of emotion; it is not enough to write this thing by hand, so it is more important to sum up things on time. In this respect, I have also met a lot of friends who are related to this fast. I can always hear a sentence that I don't like to hear, "it takes a few days to learn, it's too easy." at this time, I always confidently tell him, "it's easy to play php, but it's hard to do it well." this is true of any technology. when you know more about it, you will feel that you know too little. There are many matters needing attention in the project. Here I summarize several problems that are used frequently; the technical level is not high, and I hope to see a lot of advice from friends.

1. When logging in, ① uses the id+ password, and ② is the username + password (ID or username uniqueness):

Id is generally used because id is unique; if you want to use a user name, you have to control that the user name is unique.

two。 When designing a database-different tables may have the same fields (such as name) or keywords (such as common):

To avoid being difficult to distinguish, add a prefix or suffix to the name.

3. If you are going to jump, you'd better bring an exit ()

4. Login verification data, sql to prevent injection (select * from text where name= "?" And pass= "?") should be changed to:

Select pass from text where name= "?"; / / because the statement finds a value and you name finds it, so as long as pass

5. When executing SQL statements, you should consider whether your input conditions need to be validated.

6. Never use a superuser or owner account to connect to the database. To use an account whose permissions are strictly restricted.

7. At development time, you can use the error_reporting (E_ALL) mode to help check whether variables are checked or initialized before they are used.

8. Close the database, write a function, and call it when you need it (sometimes when you have more than 2 queries, you need to close it).

9. A database template class, table attribute variable acquisition class, table business logic class, control page, access page.

10. Small projects use hierarchical mode (there is no control layer controller), and large projects use mvc mode.

11. It is recommended that a table be built with a controller.

twelve。 Project website entrance; index entry file, still go to the controller.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report