MyBB Community Forums

Full Version: php opening tag issue
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Greetings to All,

Im having a problem when adding a php script with in code it show up like &lt;?php instead of <?php . Any idea

Regards
Net_Spy
You need the php in templates plugin to use php in templates.

http://mybbhacks.zingaburga.com/showthread.php?tid=260
Still same issue

<? instead of this im getting &lt? when im using the php code inside "code" tag . Any idea what is wrong.[/code]

<?php
hello
?>


Regards
Net_Spy
URL to an example thread??
I think this is because you are adding an space between <? and php.
well there is no space , one thing more when i removed the taf of [code] and replace that with [php] it worked . But I dont know why it did not work with [code] tag ?

Regards
Net_Spy
(2011-01-14, 09:37 PM)Shukaku Wrote: [ -> ]URL to an example thread??

I tested it on my local computers, its working.

Try this;

Open ./inc/class_parser.php file and find; (around line # 120)
$message = str_replace(array('<?php', '<!--', '-->', '?>', "<br />\n", "<br>\n"), array('&lt;?php', '&lt;!--', '--&gt;', '?&gt;', "\n", "\n"), $message);

and change it to;
$message = str_replace(array('<?php', '<!--', '-->', '?>', "<br />\n", "<br>\n"), array('<?php', '&lt;!--', '--&gt;', '?&gt;', "\n", "\n"), $message);
thanks alot Yaldaram.My issue is solved. I did little changes and this code should be change on line 119 and line 124 .

$message = str_replace(array('<?php', '<!--', '-->', '?>', "<br />\n", "<br>\n"), array('<?php', '&lt;!--', '--&gt;', '?>', "\n", "\n"), $message);

Regards
Net_Spy