ballouta Posted April 18, 2009 Share Posted April 18, 2009 I am working on fck Editor everything is ok But i am not able to view the default value that i have read from my Database. the original editor syntax is: $oFCKeditor->Value = 'Biography Goes here' ; while i want to make smthg like this: echo " $oFCKeditor->Value= '$row[cont]' ; "; how i can fix the syntax so the value is assigned correctly? thank you Link to comment https://forums.phpfreaks.com/topic/154632-solved-syntax-help/ Share on other sites More sharing options...
Mchl Posted April 18, 2009 Share Posted April 18, 2009 echo is for displaying... if you want to assign value, don't use echo... $oFCKeditor->Value= '$row[cont]' ; Link to comment https://forums.phpfreaks.com/topic/154632-solved-syntax-help/#findComment-813121 Share on other sites More sharing options...
ballouta Posted April 18, 2009 Author Share Posted April 18, 2009 Actually I did this before but when i open the editor online i see the default value as $row[cont] ! Link to comment https://forums.phpfreaks.com/topic/154632-solved-syntax-help/#findComment-813135 Share on other sites More sharing options...
Bopo Posted April 18, 2009 Share Posted April 18, 2009 Your using the wrong field, I think value used to display text in your editor by default If you haven't renamed the editor (presuming you haven't) use $post = ($_POST['FCKeditor1']) Then do whatever with the variable Link to comment https://forums.phpfreaks.com/topic/154632-solved-syntax-help/#findComment-813137 Share on other sites More sharing options...
ballouta Posted April 18, 2009 Author Share Posted April 18, 2009 this post code is correct and it is working, But i want to read teh old text stored in my database and set it as the default value for the text editor to edit. I want to add the $row[cont] instead of 'text goes here'! this is my full code: <?php include ('../global.inc.php'); include("../fckeditor/fckeditor.php") ; $result = mysql_query ("SELECT * FROM `sections` WHERE `section` = 'biography' AND `lang` = 'E'"); $row = mysql_fetch_array ($result); echo "<input name='title' type='text' size='28' value='$row[title]' dir='ltr' /> <input type='hidden' name='language' value='E' /> </label> <br /> <p>Biography Text<br />"; $content = $row[cont]; $oFCKeditor = new FCKeditor('FCKeditor1') ; $oFCKeditor->BasePath = '../fckeditor/' ; $oFCKeditor->Value = 'Text Goes here' ; $oFCKeditor->Create() ; ?> <input name="" type="image" src="../images/bt_submit.gif" /> </form> thanks alot Link to comment https://forums.phpfreaks.com/topic/154632-solved-syntax-help/#findComment-813149 Share on other sites More sharing options...
Mchl Posted April 18, 2009 Share Posted April 18, 2009 $oFCKeditor->Value= $row[cont] ; Don't know why I left these quotes... Link to comment https://forums.phpfreaks.com/topic/154632-solved-syntax-help/#findComment-813150 Share on other sites More sharing options...
soak Posted April 18, 2009 Share Posted April 18, 2009 You're nearly there first time, just remove the single quotes: $oFCKeditor->Value= $row[cont] ; Link to comment https://forums.phpfreaks.com/topic/154632-solved-syntax-help/#findComment-813151 Share on other sites More sharing options...
ballouta Posted April 18, 2009 Author Share Posted April 18, 2009 you are both graet thanks alot Link to comment https://forums.phpfreaks.com/topic/154632-solved-syntax-help/#findComment-813154 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.