Re: PHP-arnings
| From: | Julio Nobrega | Date: | Wed, 31 Oct 2001 15:46:21 +0000 |
| Subject: | Re: PHP-arnings | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-73033@lists.php.net to get a copy of this message | ||
Yeah, I got these kind of warning when I set error_reporting(E_ALL);
Anyway, this shouls do it:
<?php
if (isset($x)) {
echo $x;
}
// You could even do this:
if (isset($x)) {
if ($x) {
echo $x;
}
}
// But I guess it would be redundant :-)
?>
The point is when you get 'non defined var', just define it before, even
empty (i.e, $x = '') or check it with isset();..
--
Julio Nobrega.
Um dia eu chego lá:
http://sourceforge.net/projects/toca
"Harald Witt" <H.Witt@gmx.net> wrote in message
news:32756.1004537852@www42.gmx.net...
> Hi,
>
> I have a hopefully simple problem. Look at the following simple script:
>
> <?php
> if ($x) {
> echo $x;
> }
> ?>
>
> This script runs properly on my productive system (Linux, Apache, PHP
> 4.0.3pl1). But on my Development-System (W2k Server, Apache 1.3.20, PHP
4.0.6) I
> always get a Warning, that variable x in not definded.
> Ok, thats true. But how can I suppress that Messages??? They destroy my
> HTML-Code. I've searched in the PHP.INI file, but I can't find anything,
that
> looks like warning-suppression.
>
> Thanx for your help
>
> Harald
>
> --
> GMX - Die Kommunikationsplattform im Internet.
> http://www.gmx.net
>