Re: there must be better way to handle "Null" undefined variables
| From: | Daniel Brown | Date: | Mon, 08 Dec 2008 18:06:23 +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-29089@lists.php.net to get a copy of this message | ||
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