Jump to content

Undefined index errors


cRiMiNaL_Genius
 Share

Recommended Posts

I'm doing some work on a fancy login system that I found on-line, however it keeps giving me various undefined index errors, for the most part I do have an understanding of what that means, however I think there might be something else to it in this case, the thing is Initially I was having the problem with a script that I was working on that was based on a tutorial that I had seen as it is now I seem to be the only one that's having the problem, not only that I downloaded the original source file for the tutorial and that for the most part only shows more errors, now it could be because of my noobish-ness but even with that in mind I'd still like to get some help, I've uploaded a pic of the error but its unlikely that alone will help hence the original source files of the tutorial I mentioned http://demo.tutorialzine.com/2009/10/cool-login-system-php-jquery/demo.zip

 

and the actual demo http://demo.tutorialzine.com/2009/10/cool-login-system-php-jquery/demo.php

 

I'm not sure if you guys will get the same result however it would be nice to find out why Its not working for me... :|

 

 

[attachment deleted by admin]

Link to comment
Share on other sites

Those are "notices", rather then errors.  Everyone else probably has them disabled.  And unless you want to go through and modify the entire script, I suggest you switch them off too. 

 

The relevant setting is this: http://php.net/manual/en/function.error-reporting.php

 

You probably want this setting:

 

// Report all errors except E_NOTICE
// This is the default value set in php.ini
error_reporting(E_ALL ^ E_NOTICE);

Link to comment
Share on other sites

:-[....  :'( I've been recoding this thing for almost 2 weeks I know you're not suppose to cry over silly mistakes but this is just too sad... sigh. You know I had read some stuff about this but a few of them had warnings about turning the notices off because of security concerns, not only that I had the same problem when I was doing my security project at uni and couldn't figure what was wrong sigh.

 

Thank you very much man works perfectly.... sigh wish I had posted this sooner, now I'm going to have to recode everything from scratch again.... oh well you live and learn....

 

Thanks again btherl, really appreciate it

Link to comment
Share on other sites

Well the notices are useful.. if you are serious about writing solid code then you should have them on.  Or use a custom error handler that switches off only the ones you know you don't need.

 

But if you are taking someone else's code and plan to use it as-is, I would usually just switch them off.

 

Then again, if I wanted to take that code and check it thoroughly for any security issues and THEN use it, I would switch them on.

 

So it all depends on where the code is from and what you want to use it for, and whether you want to audit and/or modify it.

 

Just today I found a months old bug in some mature code, and I found it because notices were recently switched on on that particular development machine.

Link to comment
Share on other sites

Well um Ninja :) actually I did, it was in the post, to be honest though the problem was resolved thanks to btherl, after disabling error_reporting(E_ALL ^ E_NOTICE); the messages stopped so thanks guys both of you :)

 

Um as btherl mentioned though I am serious about coding actually I have been doing it for a few months now and though I was becoming a "pro"  :D, so for the most part all the coding I've done to date had been done with the warnings on, not only that I'd normally use isset and the get methods so that I suppose would be the main reason why I never came across this problem before.

 

 

Link to comment
Share on other sites

Well its a form innit.... but apart from that I was speaking more generally, I was tasked to create a secure chat system I had to use $_GET... well not had to but I had reason to, the information being passed from the form needed to be encrypted before going into the database and decrypted before coming out that meant that I had to use a custom js handler to process the information before it got passed to the database and then have it pulled within the that same time frame so that it could be immediately displayed on the screen... as I said it was a chat system it was really for a school project

Link to comment
Share on other sites

This thread is more than a year old. Are you sure you have something important to add to it?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.