Skip to content
Advertisement

Getting error when accessing the variable from service

I am new to PHP. I am facing an issue while login.

login.php

JavaScript

Member Service

JavaScript

When I click on the login button, I am getting the following error message:

JavaScript

What am I doing wrong here?

Advertisement

Answer

You’re trying to use a variable as an array while it is a null (most possibly not declared/instantiated). An example is :

JavaScript

To avoid this error being thrown, check if the variables are indeed set and if they are an array before using it as an array.

JavaScript

If you don’t have a post as your form action, it will be obvious as your form will post the variables using a GET, which will most likely put the variables in your url (eg. www.example.com/login?email=user@example.com)

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement