Five suggestions on php Security-PHP Tutorial-php Tutorial

Source: Internet
Author: User
Five suggestions on php Security. The combination of Chinese and English is really good. I have previously reposted my summary of php Security programming. Some people say it's an old growth talk. This time, let's look at the works of foreign friends. According to the latest survey, ph

The combination of Chinese and English is really good. I have previously reposted my summary of php Security programming. Some people say it's an old growth talk. This time, let's look at the works of foreign friends.

According to the latest survey, the usage of php language has exceeded that of the old language c ++, becoming the third-digit programming language. It has many useful functions, but there may be many problems. This article lists five common suggestions to help you create secure php applications.

PHP is one of the most popular programming languages for the web. sometimes a feature-friendly language can help the programmer too much, and security holes can creep in, creating roadblocks in the development path. in this tutorial, we will take a look at 5 tips to help you avoid some common PHP security pitfalls and development glitches.

Recommendation 1: Use error reports as appropriate

Tip 1: Use Proper Error Reporting

Error reports are useful during development. It helps you find a series of problems. However, if you still enable this function in a formal application, it will enrich the information for malicious users. You can add error_reporting (0) before the file code of all applications );

If you want to know about some problems, you should input the error report to a protected file, which can be completed using the set_error_handler function.

During the development process, application error reporting is your
Best friend. Error reports can help you find spelling mistakes in your
Variables, detect incorrect function usage and much more. However, once
The site goes live the same reporting that was an ally
Development can turn traitor and tell your users much more about your
Site than you may want them to know (the software you run, your folder
Structure, etc ).

Once your site goes live, you should make sure to hide all error
Reporting. This can be done by invoking the following simple function
At the top of your application file (s ).

Error_reporting (0 );

If something does go wrong, you still want and need to know about
It. Therefore, you shoshould always make sure to log your errors to
Protected file. This can be done with the PHP function set_error_handler.

Suggestion 2: disable the bad function of php

  • 5 pages in total:
  • Previous Page
  • 1
  • 2
  • 3
  • 4
  • 5
  • Next page

Bytes. I have previously reposted my summary of php Security programming. Some people say it's an old growth talk. This time, let's look at the works of foreign friends. According to the latest survey, ph...

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.