如何去掉ajax图片上传提示
我正在 php 中做项目。我使用 ajax 代码上传图像。 它做得很好,一切正常,但显示通知,我想 2 删除此通知...... 注意如下:
- 注意:未定义变量:errorList in C:\xampp\htdocs\ajax\scripts\ajaxupload.php on line 18 注意: 未定义的变量:errorList 中 C:\xampp\htdocs\ajax\scripts\ajaxupload.php on line 132
我不明白消息的含义是什么... 如何删除该通知?
I am doing project in php.I used ajax code to upload the image.
It done nicely, everything is working but display notice and i want 2 remove this notice...
Notice is as follows:
- Notice: Undefined variable: errorList in C:\xampp\htdocs\ajax\scripts\ajaxupload.php on line 18 Notice:
Undefined variable: errorList in
C:\xampp\htdocs\ajax\scripts\ajaxupload.php on line 132
i am not understanding what is the meaning of message...
How to remove this Notice?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要删除该通知,您必须检查此变量
$errorList
是否已定义,如果是,则检查第 18 行的ajaxupload.php
和ajaxupload.php 在线132 它是否在那里看到它或者它超出了范围。
您可以做的另一件事是放在 PHP 文件
ini_set( 'display_errors', 0 );
的开头,但这确实是个坏主意,因为Notice
是用来显示什么的你做错了。To remove the notice you must either check is this variable
$errorList
defined and if it is, then checkajaxupload.php on line 18
andajaxupload.php on line 132
does it see it there or is it out of the scope.The other thing you could do is place at the beginning of PHP file
ini_set( 'display_errors', 0 );
, but this really bad idea sinceNotice
is made to show what you are doing wrong.只需在使用变量之前将它们定义为 null,这样默认情况下它们就为 null,直到从其他地方给定值为止。在 if 块内或通过用户输入定义的变量有时不会被定义,对吧?因此,对于它们来说,需要一个默认值,这样即使没有给它们赋予值,它们至少也存在。
Simply define the variables as null before using them, so that by default they will be null until given a value from elsewhere. Variables defined inside an if block or by user input sometimes don't get defined, right? So for them, a default is needed sso that they at least exist even if they aren't given a value.