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
0
votes
1 answer

Laravel pagination: why are some pages returning undefined offset: 0?

So I have a list of about 1700 records and I want to show it paginated with five records per page and for the most part this is working with the code I have currently. The problem I am having is that when I go to certain pages I get this error:…
0
votes
2 answers

How to Fix Undefined Index Error With HTTP REFERER in Wordpress site

I am getting Error Notice Appearing on top of my Wordpress website with the following Statment: Notice: Undefined Index: HTTP REFERER in Path/wp-load.php On Line 7 I have tried to hide the notice but it doesn't fix the issue. The code in the…
Bharathan M
  • 1
  • 1
  • 1
0
votes
2 answers

Trouble with file uploads in PHP

Here I have a basic html form with an choose file input and submit button. In my linked PHP page, I am trying to display the information of the file inside of an array in the browser, but am getting an undefined index error Undefined index: file on…
Fins Up
  • 39
  • 1
  • 3
  • 13
0
votes
3 answers

Although I use isset, I get an undefined index error

I know it asks too many time. But the isset function is not solve my problem. $get = (isset($this->settings[$set['id']])) ? $this->settings[$set['id']] : ''; Notice: Undefined index: id in \public_html\settings.php on line 419
Paul Green
  • 142
  • 8
0
votes
1 answer

Getting "Undefined Index" on array created with str_getcsv(); but var_dump() shows key exists

I have an array created by using str_getcsv(): $array = array_map('str_getcsv', file($file['tmp_name'])); array_walk($array, function(&$a) use ($array) { $a = array_combine($array[0], $a); }); array_shift($array); The returned $array outputs…
Stefan Dunn
  • 5,363
  • 7
  • 48
  • 84
0
votes
0 answers

Getting Undefined variable: postType on Live website but not Testing Site

I'm pretty new with php and coding in general. For some reason I'm getting: Notice: Undefined variable: postType in /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/woocommerce-custom-product-type.php on line 213 On my live website…
0
votes
1 answer

php upload - undefined index iis

My html form looks something like this:
check123
  • 1,989
  • 2
  • 22
  • 28
0
votes
1 answer

Prestashop 1.6 php error in smarty_internal_templatebase

PrestaShop 1.6.1.20 PHP 5.6.37 Hi, I tried to install a new module on my website but i end up with this php error that i don't know how to debug. [29-Nov-2018 15:58:11 Europe/Paris] PHP Notice: Undefined index: prod in…
zieg
  • 1
  • 2
0
votes
3 answers

I'm getting undefined index error for multidimensional array in php

I'm new to php so I was trying to code a program which adds two 3x3 matrices. I'm getting undefined symbol error multiple times in php code. Is there any different way to define multidimensional arrays in php.` There are already many programs on how…
0
votes
2 answers

Undefined index error in php (dropdown filters do not work)

Hey I searched a lot about this problem but everything I tried did not work. :( My code has 3 dropdowns and they should work like search-filters but every time I select an option from the dropdown i get the undified index error for 3 lines & if I…
Taccoman
  • 59
  • 1
  • 9
0
votes
6 answers

Is it possible to avoid the warning of undefined offset PHP array?

I know the undefined offset gives out warning instead of error but I want to know is there any possible way to avoid this kind of warning to pop out? I intend to write a function to test the undefined offset because I think that writing multiple…
gitguddoge
  • 172
  • 1
  • 9
0
votes
0 answers

Query MySQL using PHP and AJAX selector form

I'm writing some PHP to query from a MySQL database that I have setup on my WAMP server. I'm also learning PHP and html javascript as I go, so the syntax of both languages is still a little unfamiliar to me. I am running two files through my…
Jonny1998
  • 107
  • 1
  • 1
  • 13
0
votes
0 answers

Ajax: How to solve undefined index error for every $_POST?

I have an ajax.Every time the ajax it's called i get Undefined index error for every data element from ajax and at the end i get another error: Cannot modify header information - headers already sent by. In network field from inspector i can see two…
Mitca Vicentiu
  • 196
  • 1
  • 14
0
votes
1 answer

Isset returns undefined index although it is set

I have a weird problem. I call a self written function which returns my SQL result. $isBusinessAddress = PartnernetShop::invoiceAddressIsBusinessAddress($userID)->toArray(); I want to get the meta_value of the first array cause this is the returned…
Jan
  • 1,180
  • 3
  • 23
  • 60
Title