For questions about php Security, use index. PHP as the homepage of the website.-php Tutorial

Source: Internet
Author: User
For php security questions, is index. PHP used as the homepage of the website secure? It is necessary to read the data library in a dynamic way, and do not use index.html to display the php file to dynamically display the php content. therefore, index is used. php is the homepage of the website. I don't know if it is safe. because index. the PHP file contains the database address and password. Is there any encryption method! I have also heard many people say that dynamic traffic is very resource-consuming. if traffic is restricted, will index. php be used as the homepage of the website for security issues?
It is necessary to read the data library in a dynamic way, and do not use index.html to display the php file to dynamically display the php content.
So index. php is used as the homepage of the website. I don't know if it is safe.
The index. php file contains the database address and database account password. Is there any encryption method!
I have heard many people say that dynamic pages consume resources. if traffic is restricted, isn't dynamic pages bad?
I am confused in many places because I just got in touch with PHP for a week. thank you very much for your enthusiastic help!

------ Solution --------------------
Index. php is the homepage of the website. I don't know if it is safe.
This does not exist. hackers will not be happy to find the vulnerability because they know that your website page is index. php. The first premise to ensure security is to filter client data (which can be called Escape) to prevent SQL injection and XSS attacks. Look at http://www.php.net/manual/zh/security.php
There is no encryption method. If someone else can see the database account password, basically the website you write will be useless. Don't worry about this. this is what others do.
Resource consumption?
Dynamic web pages require the server to perform a lot of operations (query databases, logical judgment, and so on), so it consumes a lot more system resources than static pages. A lot. If you are referring to bandwidth, there is no difference between dynamic and static. As long as you want to display the same content, static and dynamic traffic consumption is the same. In this case, the difference between dynamic and static is that the server still needs to execute the script, while static is directly read.
It is recommended that you familiarize yourself with the basic concepts of the manual to take a closer look, accumulated http://www.php.net/manual/zh/index.php
------ Solution --------------------
If there are parameters after index. php, you can add rewrite rules or encrypt the display.
If you are afraid of being insecure, you can write only one jump header () in index. php to jump to your actual homepage.

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.