Lookup domain in directories VS database
| From: | Martin Zvarík | Date: | Mon, 06 Jul 2009 02:23:23 +0000 |
| Subject: | Lookup domain in directories VS database | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-294914@lists.php.net to get a copy of this message | ||
Imagine you are hosting 10.000 subdomains.
----
SOLUTION #1:
you create directories like:
a/
b/
...
s/
s/some-subdomain.freehosting.com/ (this includes CONF.php, where you store some basic infos)
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');
----
SOLUTION #2:
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?