Common causes and solutions for PHP blank pages

Source: Internet
Author: User
Tags blank page

Compiling PHP will inevitably lead to errors. In fact, it is not difficult to solve the problem. The most difficult solution is to have a blank page. Let's think about it. If an error occurs when you write PHP, you can correct it according to the error prompt. If PHP does not show you anything, isn't it difficult for the author? Next, I will summarize the solutions and causes for the blank pages of PHP when writing PHP. Of course, I am not very good at writing PHP, so if there is an error, please do not hesitate to point it out.

1. The action is not defined.
Let's take a look at the following code:
[Code]
<? Php
$ Action = $ _ GET ['id'];
If ($ action = '')
$ Action = 1;
If ($ action = 1 ){
Echo ("$ action's value is 1 ");
} Else if ($ action = 2 ){
Echo ("$ action's value is 2 ");
}
?>
[/Code]
You can understand this code, that is, if the $ action variable is empty, set it to 1, and then determine the value of the $ action variable to make different events. Of course, what will PHP do if $ action is neither 1 nor 2 ??

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.