You are here: parse error, unexpected T_CONSTANT_ENCAPSED_STRING « All PHP « IT news, forums, messages
parse error, unexpected T_CONSTANT_ENCAPSED_STRING

Posted by christopher.j.just on 05/22/07 16:18

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\">&nbsp;</td>\n".
"<td scope=\"col\"><b>TEXT </b></td>\n".
"<td scope=\"col\">&nbsp;</td>\n".
"</tr>
<tr>
<td scope=\"row\">&nbsp;</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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация