douxunchen3498 2010-04-30 19:01
浏览 54

新用户注册,脚本自动创建问题!

im currently trying to create a php script that when a new user register, a script (eg:wordpress,blog etc..) will install for them.

I'm currently got the code below for just single setup, but how can i setup a form for multi user? which only allowing them to input the username (subdomain) and password.

<?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 );
?>

Or any tutorial that will help is appreciate! Thanks!

  • 写回答

2条回答 默认 最新

  • dongyouji7022 2010-04-30 19:06
    关注

    I guess by subdomains you want something like, user1.wordpress.com; user2.wordpress.com; user3.wordpress.com ?

    Well, actually creating subdomains is not really as complicated as it sounds

    1, you need to configure your DNS Records to accept wild card entries. this is a good read that might help. wildcard-dns-and-sub-domains

    2, define / design your application to support it; where you can filter every incoming request based on the url accessed, and take appropriate actions; display theme; or fetch data; etc.

    you might also want to look at opensource, wordpress-mu and status.net both in PHP or the Jaiku.com written in Python on Google AppEngine.

    3, configure your webserver appropriately, to accept anyname.mysite.com; and send it your app.

    评论

报告相同问题?

悬赏问题

  • ¥15 yolov8边框坐标
  • ¥15 matlab中使用gurobi时报错
  • ¥15 WPF 大屏看板表格背景图片设置
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真