Re: there must be better way to handle "Null" undefined variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



    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@xxxxxxxxx> 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@xxxxxxxxxxxx || danbrown@xxxxxxx
50% Off Hosting! http://www.pilotpig.net/specials.php

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux