/    Sign up×
Community /Pin to ProfileBookmark

Add a line of php to a html page

Would anyone know of a way to add

<?php if (ZEN_CONFIG_USER_TRACKING == ‘true’) { zen_update_user_tracking(); } ?>

to an html page? I am running a site using php but the home page is html and this would be the line of cade that would be inputted into the footer.php files to track users. Since I have an html it is not using the footer.php

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@felgallApr 15.2005 — If you are running on an Apache web server then adding the following line to your .htaccess file then all .html files will be able to include PHP.

AddType application/x-httpd-php .html

This will slightly slow the display of any other .html pages since they will all be checked for any PHP code that they might contain before delivery.
Copy linkTweet thisAlerts:
@Ben_RogersApr 15.2005 — Why not just change it to a PHP file, and then use PHP normally? You could save HTML files as PHP, and it wouldn't make a noticeable difference, assuming you're not using XML...
Copy linkTweet thisAlerts:
@leocharreApr 16.2005 — Here's another cool thing.

Make it an .shtml file. And include to a php file. You can even pass it a query string to get different outputs.

<!--#include virtual="/path2php/this.php?var1=that"-->
×

Success!

Help @mr_bill spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...