Frage

I have the following code:

echo "<script type='text/javascript'>
iframe0document.getElementById('jform_articletext').value = '<?php echo \"<p align='center'><iframe src='aufgaben/'+cookieValue+'/'+cookieValue+'.html' width='322' height='497' frameborder='0'></iframe></p>\";?>';}</script>";

but it has a problem with the quotes, I tried almost everything but it says always:

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /usr/www/users/mathea/joomla/plugins/content/DirectPHP/DirectPHP.php(58) : eval()'d code on line 118

Ok the question should be changed to php nesting in php. I need a way to negate the offect of the php nesting like it's possible for quotes with \"

War es hilfreich?

Lösung

Updated

You made PHP tags within echo. That's pretty wrong!

As I understand OP:

$text = htmlentities('<?php echo \'<pre><p align="center"><iframe src="aufgaben/"+cookieValue+"/"+cookieValue+".html" width="322" height="497" frameborder="0"></iframe></p></pre>\'; ?>');
echo "<script type='text/javascript'>
iframe0document.getElementById('jform_articletext').value = ".$text.";
</script>";

You need htmlentities function to encode characters to their html equivalents and print out php tags az plain text.

Andere Tipps

But you are already in "php mode"! Why you reopen php tag on

'<?php echo

? Then, what is "iframe0document.getElementById"?

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top