Posts: 34
Threads: 13
Joined: Nov 2010
I suppose this has been answered 100 times by now but how do I insert a simple php include on a page? I tried to it in source but it keeps adding <p> before the code and won't act on it, so I know I'm doing something wrong.
I'd appreciate any help I can get. I'm spending hours on this.
Thanks.
don
Posts: 2,928
Threads: 195
Joined: Feb 2011
Posts: 524
Threads: 48
Joined: Mar 2011
Another plugin for this task is
DynPages.
Posts: 34
Threads: 13
Joined: Nov 2010
Connie Wrote:http://get-simple.info/extend/plugin/exec-php/17/
Thanks, Connie, but there's no doc for this and I can't figure out how to use it. Perhaps you can answer: after enabling the plugin what do I put on the page itself?
Don
Posts: 2,928
Threads: 195
Joined: Feb 2011
when you have activated the plugin, you can just enter the php-code in the editor (in source code view)
Or you add that code into a component and use that component in your template.
just activate it and add
<?php
echo "hello world";
?>
into the source code of a page and see what happens
Cheers, Connie
Posts: 34
Threads: 13
Joined: Nov 2010
Connie Wrote:when you have activated the plugin, you can just enter the php-code in the editor (in source code view)
Or you add that code into a component and use that component in your template.
just activate it and add
<?php
echo "hello world";
?>
into the source code of a page and see what happens
Cheers, Connie
Connie, thanks so much for the help.
When I plug that code into the source, save it, then view it -- it works great.
But if i go back into source view it comments out my code. Is it supposed to do that? I think that's what was happening to my code. Every time I went back into source view to adjust it, the editor would comment everything out.
Don
Posts: 2,928
Threads: 195
Joined: Feb 2011
Don,
I think this is part of the editor configuration
If you use the HTML-Editor (I am sure), you have the chance to define options that the editor will not comment out that code
unfortunately I am just on the hop to travel back to Hamburg, so I can't fiddle out which setting it is
the optionslist is somewhere here:
http://docs.cksource.com/ckeditor_api/sy...onfig.html
and in our wiki you find how to configure the editor
here is something:
http://docs.cksource.com/ckeditor_api/sy...ctedSource
when you add this line to a configuration file,
Code:
config.protectedSource.push( /<\?[\s\S]*?\?>/g ); // PHP code
PHP-code will be protected