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? ?