View Full Version : Php & Html
Connie
06-04-2007, 19:11/07:11PM
Is there any way to use php includes on a html (htm) page?
The only html (htm) page I have on spam-whackers is the .com page. To update the links (navigation) I have to do it manually.
If I could get the php includes to work on that page (.com) then the navigation would update automatically like the rest of the blog when I make changes.
Danny
06-04-2007, 20:19/08:19PM
You could try adding the following to your .htaccess file :
AddType application/x-httpd-php .php .htm .html
If all is well on your server, this should instruct the server to parse php in all .html or .htm files
But Connie, if you have been consistently linking to the root of your site, then there is no problem if you start using a index.php file instead of index.htm
WebSavvy
06-04-2007, 20:49/08:49PM
Yep, what Danny said. :)
You can change the index page to .
.cfm/.asp/.php/.shtml/.html/.htm/.cgi
(or anything else) and it will be fine.
The SEs know there's an index page there, and if you've only been linking internally as spam-whackers.com/ or simply "/"
and not /index.htm ... you won't have any problems.
Connie
06-04-2007, 22:32/10:32PM
Let me digest what you both said. I've been experimenting today, but I'm about to shut down for the night.
I think you have given me the info I needed. Just need to check it out.
I know absolutely nothing about php. I hate it that WP is PHP. I would prefer a html version that used SSI rather than PHP includes.
f I were smart enough I would have set spam-whackers up so that the .com name was part of the blog. I'm not that smart so the .com name is a separate htm file.
All internal links to the home page point to http://www.spam-whackers.com
Possibly to explain a little more. If I can use the php includes for the common navigation, then I won't have to manually change them when I make changes to the common navigation in the blog.
WebSavvy
06-04-2007, 22:44/10:44PM
Connie, PM me your details and I'll go in for you tomorrow and do this for you if you'd like me to?
I don't mind.
SEFL
07-04-2007, 04:10/04:10AM
Connie: if I understand you correctly, it might not be as hard as you think. Now, I do come from a hardcore nerd background but having messed with, hacked, twisted, and turned WP around in the last few weeks, I can tell you first-hand that it's not THAT hard. It's awkward as all hell, but not hard.
Your layout will have three files in it that will contain your major navigation elements: header.php, sidebar.php, and footer.php . If you make a change in one of those files, the change will show up sitewide.
The cool part about these files is that they're mostly HTML in terms of their output. So you can go right on ahead and mess around with them (make backups first...muy importante!) just like you would an HTML file. As long as you avoid the <? ?> portions, you're good to go.
Of course, if you're anything like me and feel froggy, I say jump. ;) Mess with your files. As long as you back your site up before you go screwing around (I usually dump the site in question into a new folder on my local hard drive before messing around), you can't do that much damage.
And if you do, at least you broke something! That's part of being a man, dammit! We break ****! We have no idea what we're doing, we never admit to it, we break ****, and then we blame everyone but ourselves! That's why God gave women more brains than us. :)
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.