注意:未定义的索引消息 [英] Notice: Undefined index message

查看:66
本文介绍了注意:未定义的索引消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

.php新手,所以需要脚本帮助。

我想知道当我点击提交时如何停止显示。


注意:未定义索引:房主E:\domains\r\ ... \\\\\\\\\\\\\\\\\\\\\\\\\\一个数组,它填充字段和空白字段并通过电子邮件发送。

我不需要用户填写所有字段,这些字段在每个字段上都会产生此通知即使是空白,我确实需要发送字段。

我已经发布了我已经设法拼凑的片段,如果这有用的话。

不知怎的,我需要空白字段不要告诉我这个通知。

我用这个开始我的.php脚本

New to .php so need script help.
I want to know how to stop this being displayed when I click submit.

Notice: Undefined index: homeowner in E:\domains\r\...\user\htdocs\...\form.php on line 166

I have an array which takes filled in fields and blank fields and sends them via email.
I DON''T need the user to fill in all the fields which is resulting in this notice on every field that is not filled in. I do need the fields to be sent tho'' even if blank.
I have posted the scipt i have managed to piece together if this will help.
somehow I need the blank fields not to show me this notice.
I have started my .php script with this

展开 | 选择 | Wrap | 行号

推荐答案

Stealthmode666,

为了我们的专家和您自己的利益,这是一个发布指南,所有用户在发布代码时都使用[code]标签。这使代码更容易阅读,反过来,帮助我们的专家回答您的问题。


一个简单的方法是突出显示textarea中的代码,然后点击' textarea顶部的#按钮。


请阅读发布指南,以便您更熟悉工作原理。


谢谢,
主持人
Stealthmode666,

For the benefit of our experts and yourself, it is a posting guidelines that all users use [code] tags when posting code. This makes the code easier to read and, in turn, helps our experts answer your questions.

An easy way to do this is to highlight the code in the textarea and then hit the ''#'' button at the top of the textarea.

Please read the Posting Guidlines so you''re more familiar with how things work.

Thanks,
Moderator.


您应该检查isset()数组索引是否存在 - 或者您可以使用三元运算符来设置默认值(如果它不存在)。


请考虑以下事项:

You should check with isset() that the array index exists - or you could use ternary operator to set a default value if it doesn''t exist.

Consider the following:

展开 | 选择 | Wrap | 行号


谢谢你,但我不知道在哪里插入这个?

我正在尝试尽可能快地学习并理解非常简单的事情。我可以用html,css等编码,但除此之外我真的很挣扎,3天前我设法创建了一个webform,上传到webhost,并通过电子邮件和脚本将表单数据发回给我以上。我想尽可能多地填写教程,但说实话,其中很多都是不完整的,我需要从头到尾看到它们 - 也许我在看错了网站?对不起是如此愚蠢,但我必须从某个地方开始。
Thanks for that, but I have no idea where to insert this?
I am trying to learn as fast as I can and understand very simple things. I can code in html, css etc but beyond that i''m really struggling, 3 days ago I managed to create a webform, upload it to a webhost, and get the form data to be sent back to me via email and the script above. I am trying to cram in as many tutorials as I can but to be honest a lot of them are incomplete and I need to see them from beginning to end - maybe i''m looking at the wrong websites? sorry for being so dumb but I have to start somewhere.


这篇关于注意:未定义的索引消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆