adamf Posted July 29, 2007 Share Posted July 29, 2007 Hi All... I'm trying to add the following line of code into a php script I own but am getting the this error when I do: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/used/public_html/cont/Pages.php on line 1065 The problem is with the following code: oEdit1.cmdAssetManager="modalDialogShow ('/assetmanager/assetmanager.php',640,445);"; I add it into the page along with other code like below: <script> var oEdit1 = new InnovaEditor("oEdit1"); oEdit1.cmdAssetManager="modalDialogShow ('/assetmanager/assetmanager.php?lang=german',640,445);"; oEdit1.REPLACE("txtContent"); </script> I believe the problem is with the way my page is set up and the ' inside the ('/assetmanager/assetmanager.php',640,445) part of the code. The part of the php page which i'm trying to add this code into is a function like below: function editNav(){ $f ='TRYING TO ADD THE CODE HERE'; } return $f; Do you know how I can go about placing the code - oEdit1.cmdAssetManager="modalDialogShow ('/assetmanager/assetmanager.php,640,445');"; - into a function like above? Any advise you can provide me will be much appreciated... Regards, Adam Link to comment https://forums.phpfreaks.com/topic/62340-solved-syntax-error-unexpected-t_constant_encapsed_string/ Share on other sites More sharing options...
corbin Posted July 29, 2007 Share Posted July 29, 2007 $variable = 'oEdit1.cmdAssetManager="modalDialogShow (\'/assetmanager/assetmanager.php,640,445\');";'; //single quotes must be escaped when inside other single quotes. The same goes for quotes inside of quotes. Link to comment https://forums.phpfreaks.com/topic/62340-solved-syntax-error-unexpected-t_constant_encapsed_string/#findComment-310219 Share on other sites More sharing options...
adamf Posted July 29, 2007 Author Share Posted July 29, 2007 Works great...thanks for the quick help Link to comment https://forums.phpfreaks.com/topic/62340-solved-syntax-error-unexpected-t_constant_encapsed_string/#findComment-310226 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.