Re: PHP saying I have an undefined variable?



If you dont want to define the variable first - you can always use a
conditional to act if it doesnt exist:
if(!isset($varname))
{
do something
}
Or to supress the notices you can set the PHP error level reporting at
runtime using:
error_reporting(E_ALL ^ E_NOTICE);
That is; if you dont have access to your PHP.ini!

Regards
- FrobinRobin

ECRIA Public Mail Buffer wrote:
> Note that this is not an error but a notice - there's a difference. Errors
> will stop execution of your script, while warnings and notices are there to
> inform you of possible faulty code. Depending on your error_reporting
> setting in php.ini, you may or may not see warnings and notices. Your script
> has an undefined variable on your server but your server is just not telling
> you, because error_reporting is set to off or warn (not all).
>
> It is likely that you are using $end_while in a conditional statement before
> you have defined it, leading to the notice. You should set it to a default
> value at the beginning of your script, or before you use it.
>
> ECRIA
> http://www.ecria.com

.



Relevant Pages

  • Re: Logs remote ip when connects to exchange, ftp, or remotly to s
    ... Thanks for your help I wont argue anymore. ... I appreciate everything now I am looking for a script to extract ... >> server through remote desktop on the desktop of his server it showed the ... I just dont know how to make this script see I am going to ...
    (microsoft.public.windows.server.scripting)
  • RE: www.security7.ch.vu
    ... a server side script to access your hard drive from the web ... browser ... is stored on your computer (doh..altho i dont keep names on it etc..). ...
    (Security-Basics)
  • How to check Websphere Application Server status UP/DOWN in AIX
    ... I want to write a script which would just grep all the processes that ... Now i Dont know what all processes needs to be monitored to ensure the ... WAS server is running. ... script will b more then useful.. ...
    (comp.unix.aix)
  • Re: group policy
    ... Can't you put the shortcut in the "All users desktop" (C:\Documents and ... you can add them via this script. ... > thinking more of a script that can be run from the AD server. ... >> Why dont you log on as an administrator to add the short cut? ...
    (microsoft.public.windows.server.active_directory)
  • Re: [PHP] Passing vars w/refresh w/register globals off?
    ... Dont know why you want to, ... This wasy all you need is pass the ID within the browser. ... > switch for routing to desired pages according to form input data. ... I'm thinking the old script would be php3 and the new ...
    (php.general)