Pregunta

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 \"

¿Fue útil?

Solución

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.

Otros consejos

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

'<?php echo

? Then, what is "iframe0document.getElementById"?

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top