Hi,

I am trying to upgrade my script which currently uses globals (and 
register_globals=on) to turning that flag off.  The online documentation 
on register globas has the following code recommended by users in order 
to register the variables:

$GLOBALS["dbname"] = "dbname";

//register globals
foreach ($GLOBALS as $key=>$val) {
    if ($key !="GLOBALS') {
      eval("\$$key = '$val';");
    }
}

I am using the global array to connect to my database.  I find that if I 
insert the code above,  I get an error message that the document 
contains no data.  Can anyone tell me why?  Perhaps I would be better 
off just declaring the variable?  Would that take care of the problem?

$dbname= "dbname";

Thanks,

Nicole


-- 
########################
Nicole Lallande
[EMAIL PROTECTED]
760.753.6766
########################



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

Reply via email to