Questions tagged [undefined-index]

An index is undefined if it is not part of the array being accessed. Use this tag for questions regarding behaviour of undefined indexes or when you see undefined indexes where you don't expect them.

This notice appears when you try to access an undefined index of an array. These commonly appear when working with $_POST, $_GET or $_SESSION variables in PHP.

Use this tag for questions about the behaviour of undefined indexes or when you see undefined indexes where you don't expect them.

276 questions
1
vote
0 answers

Unable to add classList property to an array's index

Need bit of help to make memory-game, as I am trying to click element to show and open, compare inner html and if equal add the class match to keep two elements opened BUT when i click (element) card it throws error of "uncaught TypeError: cannot…
JaseyJS
  • 71
  • 7
1
vote
2 answers

Prestashop 1.6.1 Helper Form fields undefined index

I'm struggling with this for quite some hours: I'm trying to add new fields to a form generated with the HelperForm class in Prestashop for a custom module. I try to do this for the configuration page of the module in the getContent() function The…
Gabriel
  • 371
  • 1
  • 3
  • 18
1
vote
2 answers

Parsing Json into php table results in Undefined index

I am accessing API for "ConnectWise". the data comes into JSON format. i was able to parse the data into table via PHP. however, empty fields in JSON results in Undefined index. This happens for some items with no website, or address for example.…
Blazion
  • 21
  • 2
1
vote
2 answers

Undefined Index - isset guard doesn't work with helper

I have a multi-dimensional array coming from post request. It looks like this: $request['bags'][1]['fruits']. Sometimes, this value doesn't exist so it returns Undefined Index error. $model->fruits = $request['bags'][1]['fruits']; If I use an isset…
senty
  • 12,385
  • 28
  • 130
  • 260
1
vote
2 answers

Twitter API undefined PHP index

I am using this Twitter API code to display tweets on my website. Currently I am getting "undefined index" PHP errors, which do not affect functionality but I would like to know the correct way to resolve them anyway. I am guessing I need to check…
user13286
  • 3,027
  • 9
  • 45
  • 100
1
vote
1 answer

Send json to php from android error: Undefined index: ID

I try to send data from my app Android to a db mysql going from a php file. But it always returns me this error: [Sat Mar 24 12:56:42.061845 2018] [php7:notice] [pid 1035] [client 192.168.1.151 :56068] PHP Notice: Undefined index: ID_ in…
Andrea
  • 128
  • 3
  • 13
1
vote
0 answers

undefined index when using pagination

1
vote
1 answer

Notice: Undefined index: translation_domain

I apologize for my English. Some time ago I encountered a problem when developing my project on the Symfony. The problem arose in SonataAdminBundle. The error looks like this My Admin class
1
vote
3 answers

i get error when i try to upload a file?

I keep getting an error:Notice: Undefined index: on line 35 line 35: $handle = new Upload($_FILES['my_field']); this is my input field I do not understand this error, thanks!!!…
getaway
  • 8,792
  • 22
  • 64
  • 94
1
vote
1 answer

undefined index for postimg and postid array's

Here's my code, I have undefined index notices on the second to last line where I define the $params variable. Here is my call to uploadImage where I pass $params value from another file, Image::uploadImage('postimg', "UPDATE dry_posts SET postimg…
Bubba
  • 151
  • 1
  • 9
1
vote
1 answer

Undefined Index when using $_FILES to upload a picture

I'm in the process of creating an application using PHP, I'm no expert at it at all but I am slowly getting it done. I have come across a problem when allowing a user to upload information along side an image. Below is my form I set up to allow the…
1
vote
1 answer

Notice: Undefined index: picCat in E:\xampp\htdocs\Evako\admin.php on line 313

if not in the form I choose my category returns an error : Notice: Undefined index: picCat in E:\xampp\htdocs\Evako\admin.php on line 313 Code: form
Paspartu
  • 97
  • 2
  • 11
1
vote
1 answer

Wordpress Theme development: Getting Undefined index error

hello I am a wordpress theme developer. i created a theme which works fine in WP_DEBUG=False but gets undefined index error when I set WP_DEBUG=True My theme has an options page, whenever i click on save i get these errors: Notice: Undefined index:…
Towfiq
  • 397
  • 5
  • 16
1
vote
1 answer

what is session_reset() exactly?

I want to know what is session_reset() for and when should we use it ? when I use it I get an error like this: "Call to undefined index session_reset()". I hope you know something about it . Thank you in advance.
1
vote
1 answer

Undefined index errors

When I run this code on the browser, I get an error message saying that there is an undefined index. I've spent a couple hours trying to get it to work but I just don't know why I keep getting the same exact error.
FocuZst
  • 45
  • 7