.html Template files to run .php code?

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Get Involved
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
TotalMK
Registered User
Posts: 10
Joined: Thu Jul 12, 2012 9:59 am

.html Template files to run .php code?

Post by TotalMK » Thu Nov 08, 2012 3:09 pm

Hi There,

I recently am updating my website. I built a new look using basic tables and css code. It looks fantastic. It's intergrated with phpbb 3.0 but here is my problem, I can't make any of the login or php scripts run from in the template files as they are .html extension. I used to use phpbb 2 and those files were all .php extension, so running the code was no problem. Is there any way to get .php code to execute within a .html encapsulation?

Thanks
Regards,
Luke

User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: .html Template files to run .php code?

Post by Erik Frèrejean » Thu Nov 08, 2012 4:29 pm

You can embed PHP in the templates by enabling it in the "Security" section in the ACP.
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)

TotalMK
Registered User
Posts: 10
Joined: Thu Jul 12, 2012 9:59 am

Re: .html Template files to run .php code?

Post by TotalMK » Fri Nov 09, 2012 6:00 am

Thanks for the assist! I didn't think to look in "security" section, but it makes sense!

Regards,
Luke

TotalMK
Registered User
Posts: 10
Joined: Thu Jul 12, 2012 9:59 am

Re: .html Template files to run .php code?

Post by TotalMK » Sat Nov 10, 2012 8:56 am

Just like to add (cause I had to find this out on my own) if you do decide to run php script in your template files, you have to execute it differantly (see below:)

Run raw code:
<!-- PHP -->
echo "hello!";
<!-- ENDPHP -->

You may also include PHP from an external file using:
(If you do this it looks for the file in your phpbb root folder, (www.mysite.com/phpbb3/) for example tried to do a path and it didn't work.
<!-- INCLUDEPHP somefile.php -->

Locked

Return to “[3.0.x] Support Forum”