Re: reason for a "Notice:.." on one site but not another? (Same code.)

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

 



John Butler wrote:
>> http://us3.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting
>>
> 
> Thank you guys for the isset() heads up.  And Ben, for this good
> explanation of error reporting!
> 
>> As others have pointed out, it's a good idea to call isset() on a
>> POST-variable before trying to get at its value. This will avoid a
>> notice being thrown.
> 
> OK, and I can work around all this anyway, but I would love to get it
> all in one line of code, that essentially says: (pseudocode)
> if  ($IamNotEmpty && $IamEqualto='T') {
> (where those are both the same var)

if(isset($_POST['UserWishesDateRange']) && $_POST['UserWishesDateRange']
== 'T') {

-- or  --

$uwdr = $_POST['UserWishesDateRange'];

if(isset($uwdr) && $uwdr == 'T') {

-- 
Thanks!
-Shawn
http://www.spidean.com

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux