Home Backend Development PHP Tutorial PHP新手NOTICE错误常见解决方法_PHP

PHP新手NOTICE错误常见解决方法_PHP

Jun 01, 2016 pm 12:14 PM
notice

刚学习PHP,不久,一般就看看手册,和一本叫PHP和mysql web开发的。

最近在整留言板,刚才遇到个问题。

页面中,好多类似 Notice: Use of undefined constant title - assumed 'title' in D:\wamp\www\phpmysqlweb\bbs\list.php on line 17

页面很难看,很纠结啊,我用的是wamp集成包。

百度了下,看来好多朋友也有这个情况。

Notice意思是使用了没有被声明的变量,但是程序不会影响使用。难怪还是能正常运行的,就是不雅观。

解决办法有4个:

1:在上面初始化

2:打开php.ini文件

修改配置文件

error_reporting设置:

找到error_reporting=E_ALL

修改为error_reporting=E_ALL & ~E_NOTICE

3:用include把 error_reporting(E_ALL & ~E_NOTICE);写进去 //天空就是这么干的,因为是个懒人,怕打开这个那个,嘻嘻。。。。。

4:直接在文件最上面加个error_reporting(0);

准备好好搞PHP,不过遇上这个奇怪问题,还有咱有百度,神马问题,百度下,都有解决了。

新手朋友们注意了,当页面报什么错误的时候,检查代码,是否缺分号或者括号的,刚才我就犯了那些粗心问题,惭愧。

我的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)
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months 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)

PHP Notice: Use of undefined constant solution PHP Notice: Use of undefined constant solution Jun 24, 2023 pm 11:15 PM

PHPNotice: Useofundefinedconstant Solution During the PHP development process, you may encounter the error message "PHPNotice: Useofundefinedconstant". This is usually due to the use of undefined constants in the code. Constants should be defined first before they can be referenced correctly. If they are not defined or are spelled incorrectly, the above error message will appear. Here are some ways to solve this problem

How to set php not to prompt notice How to set php not to prompt notice Feb 21, 2023 am 09:12 AM

How to set php not to prompt notice: 1. Change "error_reporting" in the "php.ini" file to "error_reporting = E_ALL & ~E_NOTICE"; 2. Add the code to the specified page as "error_reporting(E_ALL ^ ​​E_NOTICE);".

PHP Notice: Undefined variable: solution in solution PHP Notice: Undefined variable: solution in solution Jun 22, 2023 pm 10:01 PM

For PHP developers, encountering the "Undefinedvariable" warning message is a very common thing. This situation usually occurs when trying to use undefined variables, which will cause the PHP script to fail to execute normally. This article will introduce how to solve the problem of "PHPNotice:Undefinedvariable: in solution". Cause of the problem: In a PHP script, if a variable is not initialized or assigned a value, "Un

PHP Notice: Undefined offset: 0 solution PHP Notice: Undefined offset: 0 solution Jun 22, 2023 am 08:12 AM

In PHP development, sometimes when we run the code, the prompt "PHPNotice: Undefinedoffset:0" will appear. This prompt is usually accompanied by an array out-of-bounds error. When the array subscript exceeds the specified range, PHP will set its value to NULL by default and give a notification message. Although this prompt message does not affect the execution of the program, it will affect the running efficiency of the program and the readability of the code. So, what should we do when encountering this situation? Here are some solutions

PHP Notice: Undefined offset solution PHP Notice: Undefined offset solution Jun 25, 2023 am 09:51 AM

PHPNotice:Undefinedoffset is a common PHP program error. It means that the program attempts to use a subscript that does not exist in the array, causing the program to fail to run normally. This error usually occurs when the PHP interpreter displays the following warning message: Notice: Undefinedoffset. Here are some ways to resolve the PHPNotice:Undefinedoffset error: Check the code First, it should

PHP Notice: A non well formed numeric value encountered - Solution PHP Notice: A non well formed numeric value encountered - Solution Aug 18, 2023 pm 06:52 PM

PHPNotice:Anonwellformednumericvalueencountered-Solution During the development process of using PHP, you often encounter some warning and error messages. One of the common warnings is "Notice:Anonwellformednumericvalueencountered". This warning usually appears when trying to convert a string to a numeric value. in the text,

Solution to PHP Notice: Trying to get property of non-object Solution to PHP Notice: Trying to get property of non-object Jun 22, 2023 pm 02:43 PM

Solution to PHPNotice: Tryingtogetpropertyofnon-object In the process of writing code in PHP, we may encounter the error message "Tryingtogetpropertyofnon-object". This error message usually occurs because we are trying to access a non-existent object property, causing an error in the code. This error message usually appears in the following situations: The object does not exist

PHP Notice: Undefined variable: arr solution PHP Notice: Undefined variable: arr solution Jun 22, 2023 pm 08:12 PM

In PHP development, you often encounter this error message: Undefined variable: arr (Undefined variable: arr). This error message usually occurs when we use undefined variables. So, if we encounter this problem, how should we solve it? This article will introduce some common methods. Defining Variables The first solution is to define variables. In PHP, if we want to use a variable, we must define it first, otherwise an "undefined variable" error will occur. change in definition

See all articles