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 Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.