By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,952 Members | 959 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,952 IT Pros & Developers. It's quick & easy.

URGENT: Index Not found error

P: n/a
Hi all

I have a php form which refers to variables like -

$HTTP_POST_VARS
$_GET
$POST

etc.

What happens is that these variables are not recognized and i get the
following error -

PHP Notice: Undefined index: status in
c:\inetpub\wwwroot\sma\members\login.php on line 71

here status is being referred to as :-

$_GET['status']

is there anything wrong with my php settings? The same code works fine
on my ISPs web server.

Please let me know why this is happenning and how to correct it - and
its needed to be fixed asap.

Thanks in advance

EY

Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
.oO(ea****@rediffmail.com)
What happens is that these variables are not recognized and i get the
following error -

PHP Notice: Undefined index: status in
c:\inetpub\wwwroot\sma\members\login.php on line 71
When do you get this error/notice? A bit more code and some more
explanations would be helpful.
here status is being referred to as :-

$_GET['status']

is there anything wrong with my php settings? The same code works fine
on my ISPs web server.


Of course $_GET['status'] only exists if the page in question was called
with an URL parameter of this name, e.g.

example.com/foo?status=42

or if a form was submitted with an input element named 'status'. If you
call the page directly without any form or parameters then PHP will
complain about the unknown index.

Micha
Jul 17 '05 #2

P: n/a
Most instances of PHP, by default, have notices turned off. Most likely
the case with your ISP. You can change your error settings in your ini
file. The error you're getting is basically telling you that you have
an undefined variable. Since PHP doesn't really care about undefined
variables, it throws you a notice instead of a typical warning or fatal
error. If you want to keep notices on for whatever reason, you'll have
to put a condition around the undefined variables to check to see if
they have a value.

Jul 17 '05 #3

P: n/a
Thanks!

The problem was i waz trying to use $_Session['xyz'] and before using
this variable one has to call - session_start() !!

without which session variables don't work. Ofcourse notices are turned
on in the error reporting thus those messages!

Now its fixed

Cheers

EY!

colyn wrote:
Most instances of PHP, by default, have notices turned off. Most likely the case with your ISP. You can change your error settings in your ini file. The error you're getting is basically telling you that you have
an undefined variable. Since PHP doesn't really care about undefined
variables, it throws you a notice instead of a typical warning or fatal error. If you want to keep notices on for whatever reason, you'll have to put a condition around the undefined variables to check to see if
they have a value.


Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.