2010-04-30 76 views
0

即時試圖創建一個PHP腳本,當一個新用戶註冊時,腳本(例如:wordpress,博客等)將爲他們安裝。新用戶註冊,腳本自動創建問題!

我目前得到的代碼如下,只是單一設置,,但我怎樣才能爲多用戶設置表單?只允許他們輸入用戶名(子域名)和密碼。

<?php 
class scriptname_Config { 

    public static $title = 'new_script_title'; 

    // Domain name and path where new script will installed in 
    public static $domain = 'username.domain.com'; 
    public static $absolutePath = '/new_register_username/'; 

    // Settings for general mysql database 
    public static $db = array(
     'host' => 'localhost', 
     'database' => 'scriptname', 
     'user' => 'root', 
     'password' => '', 
     'prefix' => 'scriptname_' 
    ); 

} 

define('scriptname_BASE_URL',  'http://'.scriptname_Config::$domain.scriptname_Config::$absolutePath); 
?> 

或任何教程,將有助於表示讚賞!謝謝!

+0

我想通過子域名你想要的東西一樣,user1.site.com; user2.site.com; user3.site.com? – phoenix24 2010-04-30 19:04:02

+0

多數民衆贊成在正確的,感謝糾正 – SKY 2010-04-30 19:05:29

回答

0

我想你想要的東西像子域名, user1.wordpress.com; user2.wordpress.com; user3.wordpress.com?

嗯,實際上是創建子域是不是真的那麼複雜,因爲它聽起來

1,你需要配置你的DNS記錄接受外卡的條目。 這是一個很好的閱讀,可能會有所幫助。 wildcard-dns-and-sub-domains

2,定義/設計你的應用程序來支持它; 您可以根據訪問的URL過濾每個傳入請求,並採取適當的操作;顯示主題;或獲取數據;等

你可能也想看看開源,wordpress-mustatus.net 無論是在PHP或者Python編寫的關於谷歌AppEngine上的Jaiku.com

3,正確配置您的網絡服務器,接受anyname.mysite.com;併發送給你的應用程序。