hi..i am new to php.i used fckeditor in my projectwith the textarea i am able to do that.but when i enter the data to the database in a paragraph its working fine.but if i enter suppose
line1
line2
line3.. its taking the space. i tried to remove the space using the trim () and addslashes().i tried all the possiblites. and then to find the stringlength but still its taking the same with counting the space..
when i retrieve the data i want my data to appear as :line1line2line3.. because later i need to find the substr() upon the retrival data so..please anyone help me.. here is my code:
<?php
include_once(“fckeditor/fckeditor.php”) ;
include(“connection.php”);
if(isset($_POST[‘Submit’]))
{
$title=$
$des=$_POST[‘descr’];
echo $q=”insert into xyz(descr)values(‘$des’)”;
echo $r=mysql_query($q);
}
?>
[B]this is fck code:
<?php
$oFCKeditor=new FCKeditor(‘descr’) ;
$oFCKeditor->BasePath=’../fckeditor/’;
echo $oFCKeditor->Value=html_entity_decode($oFCKeditor->descr);
$oFCKeditor->Width = ‘700px’ ;
$oFCKeditor->Height = ‘350px’ ;
$oFCKeditor->Create() ;
?>
[B]retrival code
<?php
$q=”select * from xyz where des=’$id’;
$r=mysql_query($q);
while($row!=NULL)
{
$d=$row[‘des’];
$r=str_replace(“rn”,””,$d); //to remove space
echo $string5=substr($r,0,300);
}
?>
please give ur suggestion.. hw can i do that.
regards