[Phpwm] subdomains & includes

Greg Jones greg.jones at gmail.com
Wed Jan 24 07:45:54 GMT 2007


>
> So:
> subdomain.example.com
> has:
> include(/admin/config/siteconfig.php);
> and that works just fine for seeing the database.
>
> But
> www.example.com
> has:
> include(http://subdomain.example.com/admin/configs/siteconfig.php);
> (which can be see to be working from an echo to the page so its not an
> incorrect path)


When you include something via http, then the content that gets included  
will be whatever you get were you to visit the URL in a browser, i.e.  
apache (or equivalent) is serving the config file as a PHP file, and code  
is executed. So you'll notice echo'd text, but assignment of variables has  
no impact on the code that does the include-ing.
One option is to rename the file to a '.inc', but then of course anyone  
can view the contents so probably not sensible for a config file...

If the files are on the same machine, then you just need to access them  
via the appropriate filepath.

Greg



-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/



More information about the Phpwm mailing list