|
Posted by christopher.j.just on 05/22/07 20:15
On May 22, 12:18 pm, christopher.j.j...@gmail.com wrote:
> I'm getting a parse error - parse error, unexpected
> T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' - on this line of
> code:
>
> "oFCKeditor.Value = "; echo preg_replace"(\"/\r\n/\", \"\\n\",
> addslashes(\"" . $VAR . "\"))";
>
> it is part of a larger block:
>
> if (!empty($query_data['VAR'])) {
> echo "<table width=\"85\" border=\"0\" cellpadding=\"0\" cellspacing=
> \"0\">\n".
> "<tr>
> <td scope=\"col\"> </td>\n".
> "<td scope=\"col\"><b>TEXT </b></td>\n".
> "<td scope=\"col\"> </td>\n".
> "</tr>
> <tr>
> <td scope=\"row\"> </td>\n".
> "<td><!-- <textarea name=\"NAME\" cols=
> \"65\" rows=\"5\" id=\"NAME\"></textarea> -->\n".
>
> "<script type=\"text/javascript\">\n".
>
> "var oFCKeditor = new FCKeditor( 'NAME ) ;\n".
> "oFCKeditor.BasePath = \"http://nominations.aacrao.org/activity/
> fckeditor/\";\n".
> "oFCKeditor.Width=500 // in pixel or %, default='100%'\n".
> "oFCKeditor.Height=500; // in pixel or %, default=200\n".
> "oFCKeditor.ToolbarSet = 'Default';\n".
>
> "oFCKeditor.Value = "; echo preg_replace"(\"/\r\n/\", \"\\n\",
> addslashes(\"" . $VAR . "\"))";
>
> echo "oFCKeditor.Create() ;\n".
> "</script>
> </td>
> </table>\n";
>
> } else {
> }
>
> I need this to work the same as:
>
> <script type="text/javascript">
> var oFCKeditor = new FCKeditor( 'NAME' ) ;
> oFCKeditor.BasePath = "http://nominations.aacrao.org/activity/
> fckeditor/";
> oFCKeditor.Width=500 // in pixel or %, default='100%'
> oFCKeditor.Height=500; // in pixel or %, default=200
> oFCKeditor.ToolbarSet = 'Default';
> oFCKeditor.Value = "<?php echo preg_replace("/\r\n/", "\
> \n",addslashes($VAR)); ?>";
> oFCKeditor.Create() ;
> </script>
>
> but each time that I try a different instance of setting the editor I
> get another error. I can get it to render basic text but the preg
> replace and addslashes are necessary to get HTML tags to render
> correctly and that's where the problem is. I've been able to have it
> pull the variable with the html tags using a basic line:
>
> "oFCKeditor.Value = \" " . $VAR ."\";\n".
>
> but if there is any HTML then it doesn't display correctly and I get a
> syntax error and things don't come through.
>
> Can anyone take a look and see where I'm making the error in the
> escaping of the problem line?
>
> Thanks,
> Chris
Never mind... figured out a solution that works cross platform.
Navigation:
[Reply to this message]
|