Re: defined
| From: | chris smith | Date: | Sun, 26 Feb 2006 00:02:42 +0000 |
| Subject: | Re: defined | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-231078@lists.php.net to get a copy of this message | ||
On 2/26/06, sub@drewpydraws.com <sub@drewpydraws.com> wrote:
> I'm having kind of a weird problem I want $MailSubject to contain a the value
> "prayer" unless I tell it other wise.
>
> // on a form processor.
> $MailSubject = "Praise";
> include_once("mailit.php");
>
> // then in mailit.php
> include "form2mail.php";
>
> // and in formtomail.php
> if(!defined($MailSubject)) // This is the problem line
> {
> $MailSubject = "Prayer";
> }
As Philip said, try if (empty($MailSubject))
defined only checks constants:
<?php
define('my_var', 'test');
if (defined('my_var')) {
echo 'found it!<br/>';
} else {
echo 'not found!<br/>';
}
?>