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

PHP空白页面常见原因及解决方法

May 25, 2016 pm 04:53 PM
Common causes

编写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");
}
?>
Copy after login

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


永久链接:

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

Statement of this Website
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

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)