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
0 answers

Undefined Index PHP $returnans

I'm trying to return the answer $returnans but it keeps telling me undefined index in line159. If anyone would be so kind to answer how I can fix this it would be greetly appreciated. Thanks if(isset($_POST['getprices'])){ …
0
votes
2 answers

why my php script always error on undefined index

I make search function in one php file. but after i separate them my coding show undefined index. Any can help me to solve this error the undefine index for the full_name not string '') { $search_string = " AND…
0
votes
1 answer

Getting an undefined index error and have no clue why totally lost on why and cant seem to find any other solutions

Hi im writing a text based adventure in which you choose from a set of choices to proceed after fiddling around i got my js function to work and react whenever i press a button however getting to load in another div when that happens hasn't gone too…
0
votes
1 answer

$id = $_GET['id']

I keep getting a notice saying Undefined index: id. Also, the code does not do what it's meant to do. Its supposed to get data from the database where the ItemID = ID. But the page just ends up blank. Help please, what can I do?
josh
  • 19
  • 1
  • 2
0
votes
0 answers

How do I fix: Notice: Undefined index?

My code (below) throws a notice, but I don't know how to fix it Undefined index in Session, ... " . "Selamat Datang " . $_SESSION["snt"] . "
0
votes
0 answers

Undefined Index error while uploading a file using php

Warning: move_uploaded_file(../uploads/IMG_23052014_111633.png): failed to open stream: No such file or directory in C:\wamp\www\test.co\getfile.php on line 8 Warning: move_uploaded_file(): Unable to move 'C:\wamp\tmp\php9EF8.tmp' to…
Tryhard
  • 5
  • 5
0
votes
2 answers

Near identical HTML forms, one posts correct value, the other doesn't

Two of my forms on my page welcome.php are as shown:

.

//spacer
Lucy Walsh
  • 17
  • 4
0
votes
4 answers

echo does not work, but the table is successfully updated

When updating my table, it works fine. but the only problem is that i can't seem to echo the fields in the input. and showing the error, undefined index. i don't get it, i tried everything. but it won't echo. For instance: Undefined index: fam_name…
Shol
  • 3
  • 2
0
votes
1 answer

Undefined offset Notice Seems Wrong

I am surprised and confused. I have a fully working php web application that is throwing an Undefined offset warning notice and I cannot see why. I use Codeigniter and have this call to a model: $data = $this->clubinfo_model->get_data($club); An…
Bill
  • 77
  • 1
  • 10
0
votes
2 answers

PHP Array_combine undefined index

I want to combine two arrays, one as a key and the other as the data. However when I print_rthe array, I see that there was a mysterious space added to the keys. Even if I take a completely different array, the spaces seem to reappear after the…
0
votes
5 answers

Array Undefined index error (notice) in PHP

I have this function: function coin_matrix($test, $revs) { $coin = array(); for ($i = 0; $i < count($test); $i++) { foreach ($revs as $j => $rev) { foreach ($revs as $k => $rev) { if ($j != $k && …
Alex
  • 5,565
  • 6
  • 36
  • 57
0
votes
2 answers

Undefined index php by POST

I have my ppf.php file: it has a form with some items,where I show data from my database, it works i have no problem with it.
Jean
  • 593
  • 2
  • 6
  • 19
0
votes
1 answer

Undefined Index: Array in Name parameter of setCookie

I know that Undefined Index questions have been asked and answered before. But please humor me for a second. I couldn't find the answer to this specific case. (And an unusual case it is.) This works without a problem...
thanks_in_advance
  • 2,603
  • 6
  • 28
  • 44
0
votes
1 answer

CodeIgniter : How to set a value on the edit page

I want to make an edit form , but I have a problem when displaying the data . This is a warning in my code .. A PHP Error was encountered Severity: Notice Message: Undefined index: pakar_username Filename: m_pakar/edit_pakar.php Line Number:…
sepuluh10
  • 1
  • 3
0
votes
0 answers

Why do i get undefined index when i have no FORMS in the code

So i want to make a dinamyic menu but i got stuck at undefined index problem can you help me figure out why ?