[RESOLVED] include "config.php" does not work anymore after PHP 5.2

liunx

Guest
Hello,

I have been working with PHP 5.0 and my "register_globals" has always been Off since PHP 4.1

Today I upgraded to PHP 5.2 and now neither of my include "config.php" work.

Neither of the variables defined in include files are even included. Anyone knows what has been changed and what can I do?


This is what I normally use

include("config.php");

mysql_connect($host,$user,$password);
@mysql_select_db("$db") or die("Unable to open database");


I echoed those connection variables and all are empty.

Thank you,
MacCould we see how config.php sets the variables?Hello

This is the same thing I always use.

<?
$host="localhost";
$user="root";
$password="123";
$db="stud";

$activation=1;

$MAXATTACHSIZE = 1000000;
$ATTACHDIRPATH="e:/www/stud/lattach/";
?>

By the way, I installed php 4.4.7 and everything is fine with this version though "register_globals" is again Off.

Regards,
Mac<? should probably be <?PHP. That's the only thing I can see that jumps out as bad. Maybe un-supress the errors on your mysql call and make sure that it's not the sql database throwing errors?Thank you very much. Now it works.

:eek: I never never thought my config.php might have problem. I have used this config.php for almost 6 years and never had problem (the first time I have forgotten to add it 6 years ago because I had migrated from ASP.

Throughout the years I have upgraded PHP and Apache (on windows and Linux) and I have never had this problem.

It's strange that how PHP has never had problem with it and finally now it has found the problem!

Thank you again.

MacNo problem. Don't forget to mark this resolved using the thread tools menu, please.In this case, the configuration setting is not register_globals, but short_tags. Keeping short_tags off is a better deal so as to avoid problems with you use the XML <?xml tag.
 
Back
Top