Pages

Custom php in static pages BUT...not in all template files! - Pages

Custom php in static pages BUT...not in all template files!

by superdan77 » Sat Apr 29, 2023 2:48 pm

hello,
I read in some posts that it is possible to write php code within the pages created by the estension.
The problem is that I also read the following:
Yes, you can use PHP code in templates.
First, enable the "Allow php in templates" option in the ACP > Security settings.
Second, put code like the following:
I don't like this: I would like pHp to be enabled only in static pages and in no other for security reasons.
Is there any workaround or mod that can do that?
Thanks
For very private msg, please contact me with the form @ https://www.cdlab.it
User avatar
superdan77
Registered User
Posts: 55
Joined: Wed Mar 29, 2023 3:14 pm

Re: Custom php in static pages BUT...not in all template fil

by MattF » Sat Apr 29, 2023 3:40 pm

Turning that on doesn't impact anything. There won't be PHP in templates until you start adding PHP to templates.
Formerly known as VSEMy ExtensionsPlease do not PM me for support.
User avatar
MattF
Extensions Development Coordinator
Extensions Development Coordinator
Posts: 6080
Joined: Sat Jan 17, 2009 9:37 am
Location: Los Angeles, CA
Name: Matt Friedman

Re: Custom php in static pages BUT...not in all template fil

by superdan77 » Tue May 02, 2023 11:55 am

ok, ive enabled "Allow php in templates" option in the ACP > Security settings but

Code: Select all

<!-- PHP -->
echo "hello!";
<!-- ENDPHP -->
gives
echo "hello!";
the php code does not get interpreted even when clearing the system cache
For very private msg, please contact me with the form @ https://www.cdlab.it
User avatar
superdan77
Registered User
Posts: 55
Joined: Wed Mar 29, 2023 3:14 pm