Jquery post request response是一个来自我的索引控制器的视图,但我并没有把它定向到那里.我有自



我使用的是最新版本的codeigniter。

我从这个post请求中得到的是我的视图。我很困惑。

我的路线:

$route['default_controller'] = "veebn";
$route['404_override'] = '';
$route['(:any)'] = "veebn/boshh/$1";

我的帖子请求:

$.post( "veebn/create_url", { weburl: weburl, width: width, height: height, dee: dee })
          .done(function( data ) {
             u = data;
             //alert(u);
    });

我的控制器:

public function create_url()
    {
        if($_POST['weburl'])
        {
            $u = $_POST['weburl'];
        }
        else
        {
            $width = NULL;
        }
        if($_POST['width'])
        {
            $width = $_POST['width'];
        }
        else
        {
            $width = NULL;
        }
        if($_POST['height'])
        {
            $height = $_POST['height'];
        }
        else
        {
            $width = NULL;
        }
        $deet = $_POST['dee'];
        //create new img
        echo $this->Img_model->get_url($u, $width, $height).$deet; 
    }

尝试isset()你的if else语句

示例

if(isset($_POST['weburl']))

相关内容

最新更新