Home  >  Article  >  Backend Development  >  Common Causes and Solutions of PHP Blank Pages_PHP Tutorial

Common Causes and Solutions of PHP Blank Pages_PHP Tutorial

WBOY
WBOYOriginal
2016-07-13 10:53:041111browse

When writing PHP, errors will inevitably occur. In fact, it is not difficult to solve errors when they occur. The most difficult thing to solve is the appearance of a blank page. Think about it, if you make an error when writing PHP, you can correct it according to the error prompts. If PHP doesn't show you anything, wouldn't it be confusing for the writer? Below, I will summarize the solutions and causes of PHP blank pages that I summarized when writing PHP. Of course, I am not very good at writing PHP, so if there are any errors, please feel free to point them out.

1. The action is undefined
First, please take a look at the following code:
[code]
$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]
This code is very clear to everyone. If the $action variable is empty, it is set to 1, and then the value of the $action variable is determined to make different events. Of course, what will PHP do if $action is neither equal to 1 nor equal to 2? ?

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632433.htmlTechArticleWhen writing PHP, errors will inevitably occur. In fact, it is not difficult to solve errors when they occur. The most difficult thing to solve is the appearance of a blank page. Think about it, if there is an error when writing PHP, you can follow the error prompts...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn