Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
02-07-2013, 08:35 PM #1
- Join Date
- Nov 2010
- southwestern USA
- Thanked 47 Times in 45 Posts
new define notices now and not before
i am not sure what it is but i have noticed lately that i have gotten alot of these
Notice: Undefined index: $value..............blah blah blah
This is something new and im not sure when this requirement began, i cleared all my notices on my last version of my script.
And now that i have gone to mysqli (which i cant see how that would make a difference here) i am starting to get these again. I am on php 5.3 right now and im not sure why every $value now it seems has to be defined ahead of time. I just never got so many before till now.
One in particular is just an error filter routine $value, when the page returns it runs thru a error value filter and displays error text on the screen.
UPDATE: i think i just figured it out, it think its because i was trying to save some keystrokes and i got rid of some of my isset usage.... i think thats why...
Last edited by durangod; 02-07-2013 at 11:15 PM.
02-07-2013, 10:43 PM #2
- Join Date
- Sep 2002
- Saskatoon, Saskatchewan
- Thanked 2,668 Times in 2,637 Posts
That would probably do it yeah.
$avalue = $_POST['avalue'];
Easiest way to save keystrokes it to use a ternary and give it a default:
$avalue = isset($_POST['avalue']) ? $_POST['avalue'] : 'a default value.';
header('HTTP/1.1 420 Enhance Your Calm');
Users who have thanked Fou-Lu for this post: