Chaos Project

General => Electronic and Computer Section => Programming / Scripting / Web => Topic started by: G_G on June 18, 2011, 04:06:26 am

Title: [PHP Being Gay] PHP Not Loading File
Post by: G_G on June 18, 2011, 04:06:26 am
For whatever reason my file isn't being "included". I have a config file.
<?php
// MySql Host
$db_host  = "localhost";
// MySql Username
$db_user  = 'root';
// MySql Password
$db_pass  = '';
// MySql Database
$database = 'testdb';
?>


Then in my index page.
<?php
include("config.php");
$db_connection = mysql_connect($db_host, $db_user, $db_pass);
$db_database = mysql_select_db($database);
?>


I'm getting errors like so.
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\Config.php on line 80

Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\Config.php on line 166

Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\Config\Container.php on line 111

Notice: Undefined variable: db_host in C:\xampp\htdocs\rmx-os\main.php on line 3

Notice: Undefined variable: db_user in C:\xampp\htdocs\rmx-os\main.php on line 3

Notice: Undefined variable: db_pass in C:\xampp\htdocs\rmx-os\main.php on line 3

Notice: Undefined variable: database in C:\xampp\htdocs\rmx-os\main.php on line 4


Which is odd because I've done this exact thing before. I'm using xampp 1.7.4. Any idea whats wrong? O_o

EDIT: What the hell Blizzard? >:U Why is there PHP syntax but no ruby? HMM?!?!? :V

EDIT 2: OMG BECAUSE FILE NAMING YOUR PHP SCRIPTS MAKES ALL THE EFFING DIFFERENCE. Apparently theres a config.php file in "C:\xampp\php\PEAR\" which the errors clearly state. So when you go to use...
include("config.php");

Its going to error, so you must rename the file. :facepalm:
Title: Re: [PHP Being Gay] PHP Not Loading File
Post by: Blizzard on June 18, 2011, 07:14:31 am
You might also wanna add "global variable_name_1, variable_name_2, etc" if some variables aren't accessible.