$mod = isset($_GET['m']) ? ucfirst($_GET['m']) : 'Index';   //默认加载Index  函数isset ucfirst() 首字母大写
$mod .= "Action";
$run = new $mod();
$run->run();

解决方案 »

  1.   

    echo $mod;
    输出的mod,(IndexAction)有这个类吗?
    有没有错误提示?
      

  2.   

    很诡异的问题 本地可以  上传到服务器 就跑不起来!你说 可能是php的版本问题吗?
      

  3.   

    $run = new $mod();
    $run->run();new mod();
      

  4.   

    $mod = isset($_GET['m']) ? ucfirst($_GET['m']) : 'Index';
    第一个$mod 是一个字符创
    $run = new $mod();而此时的$mod是一个对象
    有可能是命名之间有冲突