Please let me know How to echo textarea, Tried several versions but dint work. The whole page is in php. I am using codeigniter framework
echo "<textarea name='openletter' id='openletter' style='width: 565px;' rows='8' cols='60'>"; <?php echo "$data['openletter']"; ?> </textarea>";
You're missing very basic PHP functionality and knowledge, so I'd advice you to read some coursework on beginner PHP. also, this should fix your problem
<textarea name='openletter' id='openletter' style='width: 565px;' rows='8' cols='60'><?php echo $data['openletter'];?></textarea>
if you want everything inside an Echo :
echo "<textarea name='openletter' id='openletter' style='width: 565px;' rows='8' cols='60'>". $data['openletter'] ."</textarea>";
Try it like this:
echo "<textarea name='openletter' id='openletter' style='width: 565px;' rows='8' cols='60'>";
echo $data['openletter'];
echo "</textarea>";
Also it is possible to do it with alternative language construct:
echo "<textarea name='openletter' id='openletter' style='width: 565px;' rows='8' cols='60'>{$data['openletter']}</textarea>";
Note the use of {
and }
According to codeigniter ,best way to this is by using
form_textarea()
using from helper
<?php
$data = array(
'name' => 'field_name',
'id' => 'field_id',
'value' => 'field_value'
);
$this->load->helper('form');
echo form_textarea($data);
?>