"Richard Ellerbrock" <[EMAIL PROTECTED]> wrote in message
> The following code generates a warning when register_globals=off and
> error reporting is set to E_ALL. How do I define the constant in another
> way not to generate a warning? This is with php 4.1.1. I use defines
> extensively throughout my code and it is making my debugging difficult
> through the transition to register_global=off code.
> <?php
> define(DBF_HOST, "localhost");
> echo DBF_HOST;
> ?>
> Warning: Use of undefined constant DBF_HOST - assumed 'DBF_HOST' in
> var/www/html/iptrackdev/test.php on line 3 localhost

if (defined("DBF_HOST")) {
    echo DBF_HOST;
} else {
    echo "DBF_HOST not defined";

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

Reply via email to