开发者

Whats wrong with this php Array

This is code is giving an error(codeigniter code)

Parse error: syntax error, unexpected T_OBJECT_OPERATOR on line 25

Updated

    <?php
class Main extends CI_Controller {



    public function index()
    {
        //$this->load->view('welcome_message');
        $this->load->helper('form');
        $this->load->helper('url');
        $this->load->view('feedback');
    }

    function submit()
    {
    $this-开发者_JAVA百科>load->helper(array('form', 'url'));
    $this->load->library('form_validation');
    $this->load->helper('security');

    $data['course'] = $this->input->$this->input->post('course_attended');
    $data['trainer'] = $this->input->$this->input->post('trainer');
    $data['name'] = $this->input->$this->input->post('name');
    $data['company'] = $this->input->$this->input->post('company');
    $data['designation'] = $this->input->$this->input->post('designation');
    $data['phone'] = $this-input->$this->input->post('phone');
    $data['company_email'] = $this->input->$this->input->post('notes');
    $data['personal_email'] = $this->input->$this->input->post('personal_email');
    $data['address'] = $this-input->$this->input->post('address');
    $data['q0'] = $this->input->$this->input->post('q0');
    $data['q1'] = $this->input->$this->input->post('q1');
    $data['q2'] = $this->input->$this->input->post('q2');
    $data['q3'] = $this->input->$this->input->post('q3');
    $data['q4'] = $this->input->$this->input->post('q4');
    $data['q5'] = $this->input->$this->input->post('q5');
    $data['q6'] = $this->input->$this->input->post('q6');
    $data['q7'] = $this->input->$this->input->post('q7');
    $data['q8'] = $this->input->$this->input->post('q8');
    $data['q10'] = $this->input->$this->input->post('q10');
    $data['q11'] = $this->input->$this->input->post('q11');
    $data['aspects'] = $this->input->$this->input->post('aspects');
    $data['comments'] = $this->input->$this->input->post('comments');
    $data['ipaddress'] = $this->input->ip_address();
    $data['stamp'] = $now;


    //echo 'hi';
    print_r($data);

    }



}
?>


I'm guessing you want to change

$this->input->$this->input->

to

$this->input->


You are missing a > character in two of your property accesses:

$data['phone'] = $this-input->$this->input->post('phone');
...
$data['address'] = $this-input->$this->input->post('address');

Should be

$data['phone'] = $this->input->$this->input->post('phone');
                       ^
...
$data['address'] = $this->input->$this->input->post('address');
                         ^
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜