Take a look at the code below:
This code is part of my class. I first include the file "extension.inc" and get the value of $php_ex. Then I assign this value to the class variable php_ex (so I can use it in other functions of the class without having to include extension.inc again). At the time the value of $php_ex is ".php". However whenever I try to run the script I get the following output:PHP Code:require_once("extension.inc");
$this->php_ex=$php_ex;
echo "$php_ex<p>\n";
echo "$this->php_ex<p>\n";
require_once('config.inc' . $this->php_ex);
require_once("db.inc" .$this->php_ex);
What am I doing wrong here? I've double checked that config.inc.php exists in the same directory as this script. But as you can see it tries to include "config.inc" and not "config.inc.php" although $php_ex holds ".php"..php
.php
Warning: aoseo(config.inc) [function.aoseo]: failed to create stream: No such file or directory in ********.php on line 47
Fatal error: aoseo() [function.aoseo]: Failed opening required 'config.inc' (include_path='.;c:\php4\pear') in ********.php on line 47
Edit: I've bleeped out the script name and path above on purpose.





Bookmarks