note 54584 added to language.variables.scope
| From: | php-general at lists dot php dot net | Date: | Fri, 08 Jul 2005 13:49:58 +0000 |
| Subject: | note 54584 added to language.variables.scope | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-91671@lists.php.net to get a copy of this message | ||
$include_path = dirname(__FILE__);
include_once $include_path."/admin/config.inc.php";
//here i create variables used later
include_once $include_path."/lib/mysql.class.php";
FILE mysql.class.php
-----------------------------------
class gbook_sql {
var $conn_id;
var $result;
var $record;
var $db = array();
var $port;
function gbook_sql() {
global $GB_DB; <---------This return empty!!!!!!!!!
$this->db = $GB_DB;
if(ereg(":",$this->db['host'])) {
list($host,$port) = explode(":",$this->db['host']);
$this->port = $port;
} else {
$this->port = 3306;
}
}
How can these variebles created in other script included were accesibles in other script
included??.Any help please?. I am using PHP Version 5.0.4
Register globals is as it was by default: OFF.
----
Manual Page -- http://www.php.net/manual/en/language.variables.scope.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+54584
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54584&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54584&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54584&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54584&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54584&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54584&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+54584&report=yes
Search -- http://master.php.net/manage/user-notes.php