JJB wrote:
We regularly send out massive mail blasts to our customers. Recently
several mail blasts failed to transmit. After a serious amount of
research we found the snippet of code below to be the place where it
was breaking down. The issue it seems is that the Environment
Variables HOST and SERVER_NAME are sometimes not returning true when
executed from the Linux AT scheduler. (using atq commands). doing a
php -i from the command line returns the correct values, as does
putting in a php info command at the top of the script and opening it
from a browser.
I doubt php -i does that at all.
$ php -i | grep 'SERVER_NAME'
$
$_SERVER['SERVER_NAME'] and $_SERVER['HOST'] are set by web servers,
they are not available through php-cli.
It makes sense doesn't it? Since you don't have a server when calling a
script using cli and you don't make a request the $_SERVER and $_REQUEST
arrays are not available.
--
Thodoris
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php