Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using php within the page
#1
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
Reply
#2
http://get-simple.info/extend/plugin/exec-php/17/
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
#3
Another plugin for this task is DynPages.
Reply
#4
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
Reply
#5
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
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply
#6
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
Reply
#7
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
|--

Das deutschsprachige GetSimple-(Unter-)Forum:   http://get-simple.info/forums/forumdisplay.php?fid=18
Reply




Users browsing this thread: 1 Guest(s)