Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PHP CODE wierdness
#3
Normally php code is commented out like this in the Page-Editor

<!--?php your phpCode; ?-->

This is done by the CKEditor to protect code.

I tested following solution:
Opened file "...\admin\template\ckeditor\js\config.js and
added following code at the end:

QUOTE
// Test insert  php code
CKEDITOR.editorConfig = function(config) {
 config.protectedSource.push(/<\?[\s\S]*?\?>/g); // PHP Code
 config.protectedSource.push(/<code>[\s\S]*?<\/code>/gi); // Code tags
}
UNQUOTE

Then I put following code into a test page directly (using "Source Code")
<?php echo "Hello World"; ?>  (this is not visible in the normal input)
In  the "prewiew" the Text Hello World was written (and it was not commented out...)

Somebody here said: php code or a database connection is not neccessary. I agree, but in some cases it is
an advantage, using a database for storing and editing data.

I also use the script injector plug-in from time to time for that purpose, works fine.

Any comments appreciated...
Thats all "volks"
PauliOpa
werrechtschreibfehlerfindetdarfsiebehalten
Reply


Messages In This Thread
PHP CODE wierdness - by lakechicago - 2013-01-26, 06:39:18
RE: PHP CODE wierdness - by shawn_a - 2013-01-26, 10:08:50
RE: PHP CODE wierdness - by PauliOpa - 2015-04-20, 20:02:12



Users browsing this thread: 1 Guest(s)