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

Symfony 2 fetching data using foreign key returns Undefined index

I have 3 entities : User , UserRole , UserProfile. My primary key for the userprofile entity is actually a foreign key from user entity which is the UserId. Everytime I try to access userProfile using the foreign key userid. I always got an error…
Teffi
  • 2,498
  • 4
  • 21
  • 40
1
vote
1 answer

What is causing one PHP function to print out error text blurb, but not another?

I'm putting together a registration/login form in PHP using Netbeans. To implement this, I have my login, registration and database connection functionality in a scripts.php file, which is loaded via an include call. Well, my login function uses…
Jason
  • 11,263
  • 21
  • 87
  • 181
1
vote
2 answers

Website works fine online, but running on localhost displays undefined index and variable

having a panic here! my dissertation website works fine online, but an hour before submission i found out it doesnt work on a local host..two or 3 pages keep coming up with undefined index or variable. could anyone help? Here is a snipped of an…
AisRuss
  • 259
  • 4
  • 8
  • 16
1
vote
6 answers

undefined index and invalid foreach() argument php

I have a page which shows items which users have saved to a MYSQL database, and echos it out along with a a check box. I would like when a user clicks this check box and clicks the save button that the record will be deleted but i am met with the…
Darren Burgess
  • 4,200
  • 6
  • 27
  • 43
0
votes
2 answers

Undefined index: when variables declared

Ive looked through other posts with the same error but i get this error for every form i do where by a variable is the user input. Im having to create a 2 page process registration form, can anyone see were ive gone wrong thanks: < PHP: //…
0
votes
2 answers

In a PHP session, how do I echo out a form value that has been filled out?

--Solution found-- The correct PHP code is a combination of the two answers provided below by user1175332 and shanethehat: Correct HTML Code:
Maor Polak
  • 25
  • 5
0
votes
4 answers

Why i am getting Undefined index?

i am developing an application using CodeIgniter. In my application when i submit the form in firefox 10.0, i got this error Message: Undefined index: adcopy_response But when i submits the form in IE 9. It's working fine my application. No errors…
Rizwan Khan
  • 293
  • 3
  • 9
  • 17
0
votes
2 answers

Understanding when Model's $validate rules work

I'm trying to activate a user with CakePHP 2 by activation url, but I get a validation error used on user registration page. I've created a registration action and view, where I've defined this UserModel validation rules:
vitto
  • 19,094
  • 31
  • 91
  • 130
0
votes
3 answers

Why do I get the Undefined Index Error?

I am making a simple login form that saves to a database using MYSQL. I used a tutorial and at the end when I tested it I got an error saying 'Notice: Undefined index: login in C:\wamp\www\database_test\login.php on line 7' Don't know what this…
Dylan Buth
  • 1,648
  • 5
  • 35
  • 57
0
votes
3 answers

What's causing the mysql undefined index error with this tutorial script?

I'm running this php script at my database verbatim from a tutorial, yet I'm getting an undefined index error on line 27 (the bit that starts with if ($_REQUEST['action'] == "add") {)... I'm just learning mysql so any help would rock!
brunam
  • 825
  • 2
  • 14
  • 26
0
votes
0 answers

HTML form uploading file

I have been developing an application that allows a user to upload files to the server. I had working forms until recently, when suddenly they stopped working. All the forms that do not work any more are the forms that have the…
Jake Plaras
  • 43
  • 1
  • 4
  • 14
0
votes
1 answer

Undefined index on GET variables when trying to create reset password page in PHP

I'm working on a PHP page that allows the user to reset their password. I have got to the point where a username is entered and an email is sent with a link to change the password. However when I go to change the password I'm getting the following…
Bernard
  • 1,209
  • 3
  • 17
  • 22
0
votes
1 answer

How to chain multiple routes with Zend_Controlle

My question is how to chain multiple routes using Zend_Controller_Router_Route_Chain? For example I want to chain 3 routes for year/month/day but the gole is: when url is example.com/2011 runs index controller, year action example.com/2011/11 runs…
0
votes
3 answers

What's the difference between the two following lines of code?

I wonder why in the world the first line of code: echo('"'.$row['$Id'].'"'); results in output: "" while the second one: echo('"'); echo($row['Id']); echo('"'); Results in "71" which is exactly what I wanted to see...? I am sure that there is…
Janusz Chudzynski
  • 2,700
  • 3
  • 33
  • 46
0
votes
1 answer

When building an array from an array: IF var is SET, INCREMENT else SET to 1

Hi i've tried many solutions, but can't find what i'm after. I'm building an array from a number of other arrays, I could do something like this: isset($setinc) ? $setinc++ : $setinc=1; However when when the var is: $output[ $data[…
Ben
  • 53
  • 7