2009/7/5 Martin Zvarík <mzva...@gmail.com>:
> Imagine you are hosting 10.000 subdomains.

    Consider it done.

> Everytime visitor hits the page you do:
> @include('t/test-subdomain.freehosting.com/conf.php')
> if (!isset($CONF)) die('such a subdomain does not exist');

    .... vs....

> Everytime visitor hits the page you connect & search in a MySQL table having
> 10.000 rows with each domain name and a text field (export_var()) that has
> some parameters you need.


> What's better?

    This depends on so many external variables that it's really
impossible to give a good answer.  However, while there would be less
overhead to read a small file, I would not give the user the option to
modify a local PHP file (your first solution), which they could do if
it was stored in their local directory.  Conversely, moving it outside
of the user's directory and allowing them to read it from a central
location opens your sites up to some major XSS issues.

    So a properly-indexed database would most likely be your best
solution, based upon the limited information we have here so far.  All
in all, if you're running the server as a host with thousands of
sites, you are probably better able to better decide what's in the
best interest of yourself and your users considering the above.

</Daniel P. Brown>
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Check out our great hosting and dedicated server deals at

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to