Re: there must be better way to handle "Null" undefined variables
| From: | Fred Silsbee | Date: | Mon, 08 Dec 2008 18:24:50 +0000 |
| Subject: | Re: there must be better way to handle "Null" undefined variables | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-29090@lists.php.net to get a copy of this message | ||
if you read my original post you'd see that I already know this!
I even inserted code to fix the problem. The problem is that the
values of the variable THE FIRST TIME are undefined as shown by the code I
inserted.
I fixed the problem for one of the variables to make sure I perceived the
problem correctly not being a html guru!
The question is again "Is there a better way?"
--- On Mon, 12/8/08, Daniel Brown <danbrown@php.net> wrote:
> From: Daniel Brown <danbrown@php.net>
> Subject: Re: [PHP-WIN] there must be better way to handle "Null" undefined variables
> To: fredsilsbee@yahoo.com
> Cc: php-windows@lists.php.net
> Date: Monday, December 8, 2008, 6:06 PM
> For future reference, Fred, please only include the relevant
> code,
> not the entire script.
>
> On Mon, Dec 8, 2008 at 11:46 AM, Fred Silsbee
> <fredsilsbee@yahoo.com> wrote:
> [snip!]
> >
> > Under windows, the first page has an error <br
> /><b>Notice</b>: Undefined variable:
> ExercisePrice in
> <b>C:\Inetpub\wwwroot\new_black_scholes.php</b>
> on line <b>198</b><br />
>
> This is just a matter of the INI settings
> error_reporting and/or
> error_display being different. It's not an OS thing at
> all. You can
> change php.ini on the offending system to this:
>
> error_reporting = E_ALL | ~E_NOTICE
> ; Note that the | is the pipe character.
>
> Preferably, though, the variable on line 198 should be
> defined.
> It doesn't absolutely *NEED* to be, but good coding
> standards beg that
> you do.
>
> [snip!]
> > <input type="text"
> size="20" maxlength="40"
> name="ExercisePrice"
> > value="<?php echo $ExercisePrice;
> ?>" />
> [snip!]
>
> There's your problem. $ExercisePrice is called
> (within the <?php
> ?> tags), but was never defined before this.
>
> --
> </Daniel P. Brown>
> http://www.parasane.net/
> daniel.brown@parasane.net || danbrown@php.net
> 50% Off Hosting! http://www.pilotpig.net/specials.php