Welcome Guest, Not a member yet? Register   Sign In
Retrieve data from file:
#1

[eluser]phparif[/eluser]
How can i put data in textbox and textarea, data is in a text file. My code is:

in model:
function RetrieveTitleNotice(){
$data['title'] = readfile(base_url("title.txt")Wink;
$data['notice'] = readfile(base_url("notice.txt")Wink;
return $data;
}

in controller:
$data['notice'] = $this->dataViewRM->RetrieveTitleNotice();
$this->load->view('Register/notice',$data);

in view:
$data = array(
'name' => 'txtNotice',
'id' => 'txtNotice',
'value' => $notice[title],
'size' => '63',
'tabindex' => '0'
);
$noticeTitle = form_input($data);
echo $noticeTitle;
$data = array(
'name' => 'noticeBody',
'id' => 'noticeBody',
'value' => $notice[notice],
'rows' => '15',
'cols' => '60',
'tabindex' => '1'
);
$noticeBody = form_textarea($data);
echo $noticeBody;

But it show number of character in textbox and textarea.Now how can i do.


Messages In This Thread
Retrieve data from file: - by El Forum - 03-01-2012, 05:53 AM
Retrieve data from file: - by El Forum - 03-01-2012, 06:08 AM
Retrieve data from file: - by El Forum - 03-01-2012, 06:36 AM
Retrieve data from file: - by El Forum - 03-01-2012, 06:40 AM



Theme © iAndrew 2016 - Forum software by © MyBB