Code like:
After saving text from FCKeditor v2.0 looks like this:
<!--p echo "Hello!";-->
Its very unwell. In version 1.3.1 its works much better.
<?php echo "Hello!"; ?>
After saving text from FCKeditor v2.0 looks like this:
<!--p echo "Hello!";-->
Its very unwell. In version 1.3.1 its works much better.
RE: PHP tags converted into comments. Why?
I'm trying to make an <?php include... statement in order to integrate a php app.
Please anyone. I'm using the latest version. thxz.
RE: PHP tags converted into comments. Why?
Did you see the new 2.1 version? It has support for "allowing" stuff such as <script> or <?php ?> or <%asp%> or whatever you make up as it uses regular expressions.
Have fun!
But not too much fun, 2.1 is just a preview release...
RE: PHP tags converted into comments. Why?
perfect perfect perfect, thanks, I'll try to put restrictions on my fun
but it (is going to) saves me a lot of trouble. This will make FCKe much more versatile.
RE: PHP tags converted into comments. Why?
I'm afraid that didn't do the trick
My source code:
RE: PHP tags converted into comments. Why?
If the end user is PHP able (and trusted), I thought the idea of using something like the following:
<!--###PHP###
echo "Hello world!";
###PHP###-->
When you load the code into the editor you would convert the PHP tags (<?php and ?>) to the above and when you generate the html and then write it to a web page (if that is what you are doing), you can convert them back. Something like:
$html = str_replace ("<!--###PHP###", "<?php", $html);
Anyway, this was my idea for a possible solution. Hope this helps
Bizt
RE: PHP tags converted into comments. Why?
I tried it with <script> and it worked like a charm. Tried it with <div> and it worked like a charm.

So if it isn't working with <?php, you need to check your string.
This is all in the 2.1 preview.
Bizt's idea is really better (although it shouldn't even resemble PHP... wrap anything in custom functions and use the custom functions vs. direct php code, and you've made things safer by several fold. Still encrediblly unsafe of course, just less so) than plain PHP code.
Makes it harder for someone to cut-n-paste malicious code into your editor instance.
Even if you don't obfusicate the underlying language, they'd still have to change any <##PHP## to <?php (strike that. reverse it.), and every added second keeps another scracptler (script kiddie cracker) at bay. There are more scracptlers than you can shake a stick at anyway, but still. The one who gives up might've been the one who would've screwed you.
We can always hope, at least. =-)
Sorry so longwinded. I get that way tho.