Hi all i have a probleme with FCK and PHP,JAVA
i create all html Content via php variable
like this
$msg1 = "<table width=\"100%\" border=\"0\" bordercolor=\"#0000FF\" cellspacing=\"3\" cellpadding=\"0\">";
$msg1 .= "<tr>";
$msg1 .= "<td width=\"5\"> </td>";
$msg1 .= "<td>";
Include("mypath" . "/fckeditor.php") ;
$msg1 .= "<SCRIPT language=\"javascript\">";
$msg1 .= "var oFCKeditor;";
$msg1 .= "oFCKeditor = new FCKeditor('MyEditBox', '100%', 300) ;";
$msg1 .= "oFCKeditor.Value = '" . $text . "' ;";
$msg1 .= "oFCKeditor.Create() ;";
$msg1 .= "</SCRIPT>";
$msg1 .= "</td>";
$msg1 .= "<td width=\"5\"> </td>";
$msg1 .= "</tr>";
$msg1 .= "</table>";
And the variable text exacly like this in my mysql database
$text = "
<TABLE cellSpacing=0 cellPadding=0 width=749 border=0>
<TBODY>
<TR>
<TD vAlign=top>
<TABLE cellSpacing=5 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD class=Session align=right>Features</TD></TR></TBODY></TABLE></TD>
<TD>
<TABLE cellSpacing=5 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD align=left>The editor provides many HTML editing feature like:
<UL>
<LI><STRONG>XHTML</STRONG> support
<LI><STRONG>Font formatting</STRONG>: type, size, color, style, bold, italic, etc
<LI><STRONG>Text formatting</STRONG>: alignment, indentation, bullets list, etc
<LI>Cut, Paste and Past as Plain Text, Undo and Redo
<LI>Paste from <STRONG>Word</STRONG> cleanup with auto detection
<LI>Link creation
<LI>Image insertion, with <STRONG>upload</STRONG> and <STRONG>server browsing</STRONG> support
<LI>Table creation and editing (add, delete rows, etc)
<LI>Table cells editing (size, colors, etc)
<LI>Right click <STRONG>context menus</STRONG> support
<LI>Complete <STRONG>toolbar customization</STRONG>
<LI><STRONG>CSS</STRONG> support for a better integration in your web site
<LI><STRONG>Multi-language</STRONG> support with <STRONG>automatic</STRONG> client language <STRONG>detection</STRONG>.
<LI>Lightweight and fast
<LI>Compatible with <STRONG>Internet Explorer 5+</STRONG>
<LI>Automatic <STRONG>browser detection</STRONG> and customization
<LI>Integration with <STRONG>ASP, ASP.NET, ColdFusion, PHP, Javascript</STRONG> and <STRONG>IE Behaviours</STRONG>
<LI>Image and file <STRONG>links upload</STRONG> and server repository browser.
<LI>For web developer it is easy to install and customize
<LI>For web users its simply easy to use! </LI></UL></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE> ";
i Realy dont know why but i can edit this variable $text , Most exacly the FCKeditor dont show with no error trouble
PS i can edit other text like this
goodmsg = "<P align=center><FONT face=Verdana color=#0000ff size=7>Woow this sux</FONT></P>";
And finaly i can use this way for creating myeditbox
$oFCKeditor = new FCKeditor ;
$oFCKeditor->Value = $text ;
$oFCKeditor->CanUpload = false ; // Overrides fck_config.js default configuration
$oFCKeditor->CanBrowse = false ; // Overrides fck_config.js default configuration
$oFCKeditor->CreateFCKeditor( 'et_desdoc_" . $language_present[$i] . "', '100%', 500 ) ;
because it place the editor when i call CreateFCKeditor
Plz help me !
i create all html Content via php variable
like this
$msg1 = "<table width=\"100%\" border=\"0\" bordercolor=\"#0000FF\" cellspacing=\"3\" cellpadding=\"0\">";
$msg1 .= "<tr>";
$msg1 .= "<td width=\"5\"> </td>";
$msg1 .= "<td>";
Include("mypath" . "/fckeditor.php") ;
$msg1 .= "<SCRIPT language=\"javascript\">";
$msg1 .= "var oFCKeditor;";
$msg1 .= "oFCKeditor = new FCKeditor('MyEditBox', '100%', 300) ;";
$msg1 .= "oFCKeditor.Value = '" . $text . "' ;";
$msg1 .= "oFCKeditor.Create() ;";
$msg1 .= "</SCRIPT>";
$msg1 .= "</td>";
$msg1 .= "<td width=\"5\"> </td>";
$msg1 .= "</tr>";
$msg1 .= "</table>";
And the variable text exacly like this in my mysql database
$text = "
<TABLE cellSpacing=0 cellPadding=0 width=749 border=0>
<TBODY>
<TR>
<TD vAlign=top>
<TABLE cellSpacing=5 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD class=Session align=right>Features</TD></TR></TBODY></TABLE></TD>
<TD>
<TABLE cellSpacing=5 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD align=left>The editor provides many HTML editing feature like:
<UL>
<LI><STRONG>XHTML</STRONG> support
<LI><STRONG>Font formatting</STRONG>: type, size, color, style, bold, italic, etc
<LI><STRONG>Text formatting</STRONG>: alignment, indentation, bullets list, etc
<LI>Cut, Paste and Past as Plain Text, Undo and Redo
<LI>Paste from <STRONG>Word</STRONG> cleanup with auto detection
<LI>Link creation
<LI>Image insertion, with <STRONG>upload</STRONG> and <STRONG>server browsing</STRONG> support
<LI>Table creation and editing (add, delete rows, etc)
<LI>Table cells editing (size, colors, etc)
<LI>Right click <STRONG>context menus</STRONG> support
<LI>Complete <STRONG>toolbar customization</STRONG>
<LI><STRONG>CSS</STRONG> support for a better integration in your web site
<LI><STRONG>Multi-language</STRONG> support with <STRONG>automatic</STRONG> client language <STRONG>detection</STRONG>.
<LI>Lightweight and fast
<LI>Compatible with <STRONG>Internet Explorer 5+</STRONG>
<LI>Automatic <STRONG>browser detection</STRONG> and customization
<LI>Integration with <STRONG>ASP, ASP.NET, ColdFusion, PHP, Javascript</STRONG> and <STRONG>IE Behaviours</STRONG>
<LI>Image and file <STRONG>links upload</STRONG> and server repository browser.
<LI>For web developer it is easy to install and customize
<LI>For web users its simply easy to use! </LI></UL></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE> ";
i Realy dont know why but i can edit this variable $text , Most exacly the FCKeditor dont show with no error trouble
PS i can edit other text like this
goodmsg = "<P align=center><FONT face=Verdana color=#0000ff size=7>Woow this sux</FONT></P>";
And finaly i can use this way for creating myeditbox
$oFCKeditor = new FCKeditor ;
$oFCKeditor->Value = $text ;
$oFCKeditor->CanUpload = false ; // Overrides fck_config.js default configuration
$oFCKeditor->CanBrowse = false ; // Overrides fck_config.js default configuration
$oFCKeditor->CreateFCKeditor( 'et_desdoc_" . $language_present[$i] . "', '100%', 500 ) ;
because it place the editor when i call CreateFCKeditor
Plz help me !
RE: FCK and JAVA + PHP Variable
This might help,
in your code:
$msg1 .= "<SCRIPT language=\"javascript\">";
$msg1 .= "var oFCKeditor;";
$msg1 .= "oFCKeditor = new FCKeditor('MyEditBox', '100%', 300) ;";
$msg1 .= "oFCKeditor.Value = '" . $text . "' ;";
$msg1 .= "oFCKeditor.Create() ;";
$msg1 .= "</SCRIPT>";
You might add some newline characters:
$msg1 .= "<SCRIPT language=\"javascript\">\n";
$msg1 .= "var oFCKeditor;\n";
$msg1 .= "oFCKeditor = new FCKeditor('MyEditBox', '100%', 300) ;\n";
$msg1 .= "oFCKeditor.Value = '" . $text . "' ;\n";
$msg1 .= "oFCKeditor.Create() ;\n";
$msg1 .= "</SCRIPT>\n";
That might at least make it easier to debug when you view source to see what it actually outputs.
I notice that your 'goodmsg' does not contain any quotes and the contents of $text does.
For the reading in and out of the database you might try addslahes() and stripslashes()
And again the results of 'view source' are always helpful.
-Jim
RE: FCK and JAVA + PHP Variable
Hey thanks for the quick help
ok i will write the real source for recreate the situation
java_bug.php
RE: FCK and JAVA + PHP Variable
Hi again
i notice that if i convert the $text1 variable by
$text1 = "<TABLE cellSpacing=0 cellPadding=0 width=749 border=0>";
$text1 .= "<TBODY>";
$text1 .= "<TR>";
$text1 .= "<TD vAlign=top>";
$text1 .= "<TABLE cellSpacing=5 cellPadding=0 width=\"100%\" border=0>";
$text1 .= "<TBODY>";
$text1 .= "<TR>";
$text1 .= "<TD class=Session align=right>Features</TD></TR></TBODY></TABLE></TD>";
$text1 .= "<TD>";
$text1 .= "<TABLE cellSpacing=5 cellPadding=0 width=\"100%\" border=0>";
$text1 .= "<TBODY>";
$text1 .= "<TR>";
$text1 .= "<TD align=left>The editor provides many HTML editing feature like:";
$text1 .= "<UL>";
$text1 .= "<LI><STRONG>XHTML</STRONG> support";
$text1 .= "<LI><STRONG>Font formatting</STRONG>: type, size, color, style, bold, italic, etc";
$text1 .= "<LI><STRONG>Text formatting</STRONG>: alignment, indentation, bullets list, etc";
$text1 .= "<LI>Cut, Paste and Past as Plain Text, Undo and Redo";
$text1 .= "<LI>Paste from <STRONG>Word</STRONG> cleanup with auto detection";
$text1 .= "<LI>Link creation";
$text1 .= "<LI>Image insertion, with <STRONG>upload</STRONG> and <STRONG>server browsing</STRONG> support";
$text1 .= "<LI>Table creation and editing (add, delete rows, etc)";
$text1 .= "<LI>Table cells editing (size, colors, etc)";
$text1 .= "<LI>Right click <STRONG>context menus</STRONG> support";
$text1 .= "<LI>Complete <STRONG>toolbar customization</STRONG>";
$text1 .= "<LI><STRONG>CSS</STRONG> support for a better integration in your web site";
$text1 .= "<LI><STRONG>Multi-language</STRONG> support with <STRONG>automatic</STRONG> client language <STRONG>detection</STRONG>.";
$text1 .= "<LI>Lightweight and fast";
$text1 .= "<LI>Compatible with <STRONG>Internet Explorer 5+</STRONG>";
$text1 .= "<LI>Automatic <STRONG>browser detection</STRONG> and customization";
$text1 .= "<LI>Integration with <STRONG>ASP, ASP.NET, ColdFusion, PHP, Javascript</STRONG> and <STRONG>IE Behaviours</STRONG>";
$text1 .= "<LI>Image and file <STRONG>links upload</STRONG> and server repository browser.";
$text1 .= "<LI>For web developer it is easy to install and customize";
$text1 .= "<LI>For web users its simply easy to use! </LI></UL></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>";
i cand echo($msg1)
i try first with \n at all ending line but that not working. I dont know what the \n make (make like a <br> ?) but i thing that i need exacly the remove jump line
Can someone help me ?
War
RE: FCK and JAVA + PHP Variable
It is a problem with quotes.
In your example you use the javascript version of the editor.
It's content is loaded into a javascript tag. the tag uses single quotes. if there are any single quotes in the string loaded into this javascript tag, it terminates the string and causes an error.
The code that follows reflects this fix and it works.
(Adjust the FCKeditor path)
My question is (I hate it when other people ask me this, but at least I solved the original problem first...) why are you doing it this way? You are already using a php page, why not use the php version of the editor? It does not have this same sensitivty to quotes.
Hope I helped,
-Jim
RE: FCK and JAVA + PHP Variable
-Jim
RE: FCK and JAVA + PHP Variable
Tanks for the help Jim
i use FCK in this way because i need to call a function that return my string that will be content
after this hi echo the string content were i wanna.
If i use this way to make FCK
$oFCKeditor = new FCKeditor ;
$oFCKeditor->Value = $text ;
$oFCKeditor->CanUpload = false ; // Overrides fck_config.js default configuration
$oFCKeditor->CanBrowse = false ; // Overrides fck_config.js default configuration
$oFCKeditor->CreateFCKeditor( 'et_desdoc_" . $language_present[$i] . "', '100%', 500 ) ;
That will make the editor appear when i will call $oFCKeditor->CreateFCKeditor. If you check my case i dont wanna make apear the editor when i making my string content variable ($msg1 and $msg2)
The trouble is that i need to make a one line variable forl the value of FCK
This variable doesnt work because of the \n that make a jump line in the source, like i said can remove all the jump line from a variable via PHP ?
$text1 = "<b>Romve the slash n for working</b><br>\n";
$text1 .= "<b>Working now</b>";
And again this is exacly how the data are in my database when i got it.
$text = "
<TABLE cellSpacing=0 cellPadding=0 width=749 border=0>
<TBODY>
<TR>
<TD vAlign=top>
<TABLE cellSpacing=5 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD class=Session align=right>Features</TD></TR></TBODY></TABLE></TD>
<TD>
<TABLE cellSpacing=5 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD align=left>The editor provides many HTML editing feature like:
<UL>
<LI><STRONG>XHTML</STRONG> support
<LI><STRONG>Font formatting</STRONG>: type, size, color, style, bold, italic, etc
<LI><STRONG>Text formatting</STRONG>: alignment, indentation, bullets list, etc
<LI>Cut, Paste and Past as Plain Text, Undo and Redo
<LI>Paste from <STRONG>Word</STRONG> cleanup with auto detection
<LI>Link creation
<LI>Image insertion, with <STRONG>upload</STRONG> and <STRONG>server browsing</STRONG> support
<LI>Table creation and editing (add, delete rows, etc)
<LI>Table cells editing (size, colors, etc)
<LI>Right click <STRONG>context menus</STRONG> support
<LI>Complete <STRONG>toolbar customization</STRONG>
<LI><STRONG>CSS</STRONG> support for a better integration in your web site
<LI><STRONG>Multi-language</STRONG> support with <STRONG>automatic</STRONG> client language <STRONG>detection</STRONG>.
<LI>Lightweight and fast
<LI>Compatible with <STRONG>Internet Explorer 5+</STRONG>
<LI>Automatic <STRONG>browser detection</STRONG> and customization
<LI>Integration with <STRONG>ASP, ASP.NET, ColdFusion, PHP, Javascript</STRONG> and <STRONG>IE Behaviours</STRONG>
<LI>Image and file <STRONG>links upload</STRONG> and server repository browser.
<LI>For web developer it is easy to install and customize
<LI>For web users its simply easy to use! </LI></UL></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE> ";
I need the remove all \n or jump line in $text
i dont know if you understand my jim but help will be nice
War
RE: FCK and JAVA + PHP Variable
Hi Jim i finaly find why i can pass $text1 variable to the java value of FCK
$text1 = "
<TABLE cellSpacing=0 cellPadding=0 width=749 border=0>
<TBODY>
<TR>
<TD vAlign=top>
<TABLE cellSpacing=5 cellPadding=0 width=\"100%\" border=0>
<TBODY>
<TR>
<TD class=Session align=right>Features</TD></TR></TBODY></TABLE></TD>
<TD>
<TABLE cellSpacing=5 cellPadding=0 width=\"100%\" border=0>
<TBODY>
<TR>
<TD align=left>The editor provides many HTML editing feature like:
<UL>
<LI><STRONG>XHTML</STRONG> support
<LI><STRONG>Font formatting</STRONG>: type, size, color, style, bold, italic, etc
<LI><STRONG>Text formatting</STRONG>: alignment, indentation, bullets list, etc
<LI>Cut, Paste and Past as Plain Text, Undo and Redo
<LI>Paste from <STRONG>Word</STRONG> cleanup with auto detection
<LI>Link creation
<LI>Image insertion, with <STRONG>upload</STRONG> and <STRONG>server browsing</STRONG> support
<LI>Table creation and editing (add, delete rows, etc)
<LI>Table cells editing (size, colors, etc)
<LI>Right click <STRONG>context menus</STRONG> support
<LI>Complete <STRONG>toolbar customization</STRONG>
<LI><STRONG>CSS</STRONG> support for a better integration in your web site
<LI><STRONG>Multi-language</STRONG> support with <STRONG>automatic</STRONG> client language <STRONG>detection</STRONG>.
<LI>Lightweight and fast
<LI>Compatible with <STRONG>Internet Explorer 5+</STRONG>
<LI>Automatic <STRONG>browser detection</STRONG> and customization
<LI>Integration with <STRONG>ASP, ASP.NET, ColdFusion, PHP, Javascript</STRONG> and <STRONG>IE Behaviours</STRONG>
<LI>Image and file <STRONG>links upload</STRONG> and server repository browser.
<LI>For web developer it is easy to install and customize
<LI>For web users its simply easy to use! </LI></UL></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE> ";
i only need to make this i got it
$text1 = str_replace(chr(13), "", $text1);
$text1 = str_replace(chr(10), "", $text1);
Thanks for your help i finnaly found it