Previous Thread
Next Thread
Print Thread
Hop To
Joined: Jun 2006
Posts: 197
E
enthusiast
enthusiast
E Offline
Joined: Jun 2006
Posts: 197
This could be a very basicly question but PHP is not my main stream...
I do have my index page on my server that is 'index.html'
I want to display a custom island on that page, that is this one below:
---------
<?php
if (!defined('UBB_MAIN_PROGRAM')) define('UBB_MAIN_PROGRAM',1);
$style_side="";$tbopen="";$tbclose="";
echo "<table width=\"100%\">";
include("/www/forum/languages/portuguese/portal_islands.php");
include("/www/forum/languages/portuguese/generic.php");
include("/www/forum/cache/post_island_12.php");
echo "</table>";
?>
-----------

The problem is that when I put it on my 'index.html' page, it display as a plain text.
If I change the name of my index to 'index.php' it display right

For a reason I don't want to start changing all my .html pages that will have custon islands, to be a .php pages.
What would be the work around?

Thank you

Joined: Jun 2006
Posts: 197
E
enthusiast
enthusiast
E Offline
Joined: Jun 2006
Posts: 197
answering my own question, just in case you may need it:

For Apache Servers Edit your .htacess with AddType application/x-httpd-php .htm .html Then Add the php code from the reader directly to your html pages

Joined: Jun 2006
Posts: 16,299
Likes: 116
UBB.threads Developer
UBB.threads Developer
Joined: Jun 2006
Posts: 16,299
Likes: 116
.html files are not parsed by php, unless you explicidly set your server to do so; thus, php code in the index.html page will not parse as php code, it will show inline as regular text.

I would however recommend against doing this, as it will add overhead as all html/htm files will parse through php when they won't all have php coding in them; instead, utilize files with the .php extension when needed.


I am a Web Development Contractor, I do not work for UBBCentral. I have provided free User to User Support since the beginning of these support forums.
Do you need Forum Install or Upgrade Services?
Forums: A Gardeners Forum, Scouters World
UBB.threads: UBBWiki, UBB Styles, UBB.Sitemaps
Longtime Supporter & Resident Post-A-Holic
VNC Web Services: Code Modifications, Upgrades, Styling, Coding Services, Disaster Recovery, and more!

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
Is UBB.threads still going?
by Aaron101 - 04/01/2022 8:18 AM
Who's Online Now
0 members (), 868 guests, and 467 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)