Page 1 of 1

[SOLVED] OC 3031 PHP Notice: Undefined index: name in .../catalog/controller/.../...php on line ...

Posted: Tue Mar 28, 2023 12:02 am
by parkookk
Hi,
I have OC3031 and currently get the following erros:
How can I fix them?

PHP Notice: Undefined index: name in .../catalog/controller/information/contact.php on line 145
PHP Notice: Undefined index: email in .../catalog/controller/information/contact.php on line 149
PHP Notice: Undefined index: enquiry in .../catalog/controller/information/contact.php on line 153

PHP Notice: Undefined index: password in .../catalog/controller/account/login.php on line 174
PHP Notice: Undefined index: email in .../catalog/controller/account/login.php on line 160, 167, 174, 177

PHP Notice: Undefined index: firstname in .../catalog/controller/account/register.php on line 221
PHP Notice: Undefined index: lastname in .../catalog/controller/account/register.php on line 225
PHP Notice: Undefined index: email in .../catalog/controller/account/register.php on line 229, 233
PHP Notice: Undefined index: telephone in .../catalog/controller/account/register.php on line 237
PHP Notice: Undefined index: password in .../catalog/controller/account/register.php on line 263, 267
PHP Notice: Undefined index: confirm in .../catalog/controller/account/register.php on line 267

Regards,
Morty

Re: OC 3031 PHP Notice: Undefined index: name in .../catalog/controller/.../...php on line ...

Posted: Tue Mar 28, 2023 12:27 am
by by mona
in contact put in the required fields:
name, email, enquiry
before pressing the submit button

in login put in the required fields:
password, email
before pressing the submit button

in register put in the required fields
firstname, lastname, email, telephone, password, confirm
before pressing the submit button

Re: OC 3031 PHP Notice: Undefined index: name in .../catalog/controller/.../...php on line ...

Posted: Tue Mar 28, 2023 5:12 pm
by parkookk
by mona wrote:
Tue Mar 28, 2023 12:27 am
in contact put in the required fields:
name, email, enquiry
before pressing the submit button

in login put in the required fields:
password, email
before pressing the submit button

in register put in the required fields
firstname, lastname, email, telephone, password, confirm
before pressing the submit button
Thanks, customers and bots do whatever they like and it's out of our control. Is there a way to prevent this in the first place by imporving the code?

Re: OC 3031 PHP Notice: Undefined index: name in .../catalog/controller/.../...php on line ...

Posted: Tue Mar 28, 2023 5:17 pm
by parkookk
For now I have changed it as the following codes

in php.ini

find
error_reporting = E_ALL;
replace with
error_reporting = E_ALL & ~E_NOTICE;

Re: OC 3031 PHP Notice: Undefined index: name in .../catalog/controller/.../...php on line ...

Posted: Tue Mar 28, 2023 5:57 pm
by JNeuhoff
As long as you have a proper web theme for the information/contact.twig, these fields should always be submitted anyway, even if some of them are empty, in which case the validation would notice and generate regular error messages in its response, and not as PHP Notice messages!

The only way you can get these strange PHP Notice errors is from spambots. Try our SpamBot Buster to stop them.

Re: [SOLVED] OC 3031 PHP Notice: Undefined index: name in .../catalog/controller/.../...php on line ...

Posted: Tue Jun 06, 2023 8:10 pm
by parkookk
I now use OC3038 with default theme and 7 small extensions.
On a working website, is it safe to have "error_reporting = E_ALL & ~E_NOTICE" in php.ini?
If no, then how else is safe to see the errors?
Thanks

Re: [SOLVED] OC 3031 PHP Notice: Undefined index: name in .../catalog/controller/.../...php on line ...

Posted: Thu Sep 19, 2024 7:16 pm
by parkookk
I think it's fixed now. Recently I realised all of my OC sites have registration issue. The page registers people but doesn't show a new page as if nothing has happend.
So thanks to @mona, I have now found out that years ago I probably needed an edit and found a spam code that doesn't do anything but to create this conflict and I have used it in:
catalog/controller/account/register.php
Then found and removed it:

Code: Select all

if (!isset($this->request->post['firstname']) || !isset($this->request->post['lastname']) || !isset($this->request->post['email']) || !isset($this->request->post['telephone']) || !isset($this->request->post['password']) || !isset($this->request->post['register'])) return false;
And now users can register and get a success message. :drunk: