PHP novice NOTICE common solution for errors

  • 2020-05-10 17:47:20
  • OfStack

Soon after learning PHP, I looked at the manual and developed one called PHP and mysql web.

Recently in the whole message board, just met a problem.

On the page, a lot of things like Notice: Use of undefined constant title title' title' in D:\wamp\www\phpmysqlweb\bbs\list.php on line 17

The page is ugly and tangled. I'm using the wamp integration package.

Baidu down, it seems that a lot of friends also have this situation.

Notice means that variables that are not declared are used, but the program does not affect the use. No wonder it can still function normally, it is unsightly.

There are four solutions:

1: initialize on top

2: open php.ini

Modify the configuration file

error_reporting Settings:

Find error_reporting = E_ALL

Change to error_reporting=E_ALL & ~E_NOTICE

3: error_reporting(E_ALL & ~E_NOTICE) with include; Write in // the sky is so dry, because is a lazy person, afraid to open this and that, hee hee...

4: directly add error_reporting(0) to the top of the file;

Prepare to do PHP, but encounter this strange problem, and za have baidu, what problem, baidu, have been solved.

Novice friends attention, when the page reported what the error, check the code, whether the semicolon or parentheses, I just made those careless problems, ashamed.

My path of PHP is doomed to be difficult, but I will not give up, 1 must do well. Come on.

Related articles: