Page 1 of 1
basic config..forgot..!
Posted: Tue Jul 06, 2004 4:25 am
by crypdude
Now i using easyphp for my php. then when i open my web in localhost then this errors occur. Before there is no problem but now this errors appear..
Notice: Undefined index: login in c:\program files\easyphp1-7\www\idcv1.01\index.php on line 2
Notice: Undefined variable: login in c:\program files\easyphp1-7\www\idcv1.01\index.php on line 4
Notice: Undefined variable: InvoiceMaster in c:\program files\easyphp1-7\www\idcv1.01\header.php on line 21
I thing, i miss up in php setting.. anybody kat help me..??
Posted: Tue Jul 06, 2004 4:26 am
by launchcode
What is on line 2? (or 4, or 21 for that matter).
Posted: Tue Jul 06, 2004 4:31 am
by markl999
It's just a NOTICE not an ERROR as such

It just means you've got something like $foo['login'] where $foo['login'] isn't set/defined.
Posted: Tue Jul 06, 2004 7:06 am
by patrikG
By default NOTICE reporting is off in PHP. To run your scripts without being notified on whether or not a variable has been initialised (just and example), use:
Code: Select all
error_reporting (E_ALL ^ E_NOTICE);
You can safely ignore NOTICES. For more details see [php_man]error_reporting[/php_man].
Posted: Tue Jul 06, 2004 7:29 am
by redmonkey
patrikG wrote:You can safely ignore NOTICES.
Essentially yes, but developing your scripts/apps with error_reporting set to 'E_ALL' can save you hours of work when it comes to debugging.
I have seen people spend literally hours trying to work out why their script/function is not returning the expected results, only to discover that the variable they have passed was mispelt.
If your error level is set to 'E_ALL' then you will be immediately alerted to the fact the the mispelt variable does not exist (assuming of course that you have not spelt the varaibale as another one which does exist).
Personally I would recommend you develop your scripts/apps with error_reporting set to 'E_ALL', it does have other uses to apart from that I mentioned above.
Posted: Tue Jul 06, 2004 11:31 pm
by crypdude
if set error_reporting(0), then my webpage can't work like normal.. i thinks i miss up on the php configuration itself... wat should i do..??
Posted: Tue Jul 06, 2004 11:47 pm
by markl999
Instead of doing stuff like:
if($foo['login']){
....
}
do:
if(!empty($foo['login'])){
....
}
That should prevent those notices.
Posted: Fri Jul 09, 2004 4:22 am
by crypdude
what variable $foo can do? What $foo really is? Thanks!
Actually, before this this same code i use with different computer and different OS, this stuff work... but when i set a new PHP setup(PHP,MySql, phpmyadmin) then this warning appear... Actually this is not just warning at all.. this warning can make my web doesnt work..
I think i miss some configuration for my PHP, actually i'm using easyPHP to ease my PHP configuration...
Thanks!
Posted: Fri Jul 09, 2004 10:26 am
by feyd
crypdude wrote:what variable $foo can do? What $foo really is? Thanks!
WHAT THE HELL IS A $FOOOOO[bar]
Posted: Fri Jul 09, 2004 11:17 am
by xisle
foobar: n.
[very common] Another widely used metasyntactic variable; see foo for etymology. Probably originally propagated through DECsystem manuals by Digital Equipment Corporation (DEC) in 1960s and early 1970s; confirmed sightings there go back to 1972. Hackers do not generally use this to mean FUBAR in either the slang or jargon sense. See also Fred Foobar. In RFC1639, “FOOBAR” was made an abbreviation for “FTP Operation Over Big Address Records”, but this was an obvious backronym. It has been plausibly suggested that “foobar” spread among early computer engineers partly because of FUBAR and partly because “foo bar” parses in electronics techspeak as an inverted foo signal; if a digital signal is active low (so a negative or zero-voltage condition represents a "1") then a horizontal bar is commonly placed over the signal label.
source 
Posted: Fri Jul 09, 2004 11:04 pm
by crypdude
crypdude wrote:
Actually, before this this same code i use with different computer and different OS, this stuff work... but when i set a new PHP setup(PHP,MySql, phpmyadmin) then this warning appear... Actually this is not just warning at all.. this warning can make my web doesnt work..
I think i miss some configuration for my PHP, actually i'm using easyPHP to ease my PHP configuration...
So how?