0

In php I have a page index1.php that starts like this:

require_once ('mysql_connect.php'); 
require_once ('includes/login_functions.inc.php');

In my mysql_connect.php, the last two lines are:

global $dbc;
$dbc = connect_to_db(); ?>

Now, in login_functions.inc.php I use $dbc within a function, but I get the following error:

Undefined variable: dbc in /var/www/[a few sub directories]/includes/login_functions.inc.php 

Why can't login_functions.inc.php see $dbc? What am I missing?

fiacobelli
  • 1,960
  • 5
  • 24
  • 31

0 Answers0