/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Help with XAMPP and PHP includes

I need a bit of help. I have XAMPP up and running and was able to get ssi’s displayed. However, I can’t get a PHP include to display (although PHP is working). I have this in my .htaccess file (my files end in “.htm”):

[CODE]
AddType text/html .htm
AddHandler server-parsed .htm
Options Indexes FollowSymLinks Includes[/CODE]

The include file (“upperNav.php”) is:

[CODE]
<?php
if ($thisPage==’online’)
{echo ”;}
else
{echo ‘<a href=”online.htm”>
listen online<span>listen online</span>
</a>’;}?>
&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;

<?php
if ($thisPage==’order’)
{echo ”;}
else
{echo ‘<a href=”#nogo1″>
order<span>order</span>
</a>’;}?>
&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;

<?php
if ($thisPage==’contact’)
{echo ”;}
else
{echo ‘<a href=”contact.htm”>
contact<span>contact</span>
</a>’;}?>
&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;

<?php
if ($thisPage==’home’)
{echo ”;}
else
{echo ‘<a href=”index.htm”>
home<span>home</span>
</a>’;}?>[/CODE]

I’m calling it with:

[CODE]
<?php include(“includes/upperNav.php”); ?>[/CODE]

Any ideas why it’s not working?

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@Markbad311Sep 28.2006 — is the file you are including it in a .php file? You can't have a server side include on a .htm file because your php engine does not recognize it as something it has to parse.
Copy linkTweet thisAlerts:
@LeeUauthorSep 29.2006 — Aha! I changed the name of the index.htm file to index.php and it works. I'm used to using ".inc" files. I'll just need to change the extensions to ".php" Thanks, I appreciate it!
×

Success!

Help @LeeU 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 6.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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...