search
Homephp教程php手册PHP空白页面常见原因及解决方法

编写PHP,难免会出现错误。其实出现错误也不难解决,最难解决的是出现空白页面。大家想想看,若编写PHP出现错误,可以根据错误的提示来改正,倘若PHP什么也不给你显示,那岂不是让编写者困挠不已?下面,我就把我在编写PHP时总结出来的有关PHP空白页面的解决方法以及产生原因。当然,本人写PHP并不是很高手,所以假如有错误,请不惜指出。

1、动作未定义:先请大家看一看下面的代码:

<?php
$action = $_GET[&#39;id&#39;];
if ($action == &#39;&#39;) $action = 1;
if ($action == 1) {
    echo ("$action&#39;s value is 1");
} else if ($action == 2) {
    echo ("$action&#39;s value is 2");
}
?>

这段代码大家看得很明白,就是假如$action变量为空时将它设为1,然后判定$action变量的值而做出不同的事件。当然,假如$action既不等于1,也不等于2的时候,PHP会做什么呢??


永久链接:

转载随意!带上文章地址吧。

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

Hot Tools

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor