Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 04-02-2007, 11:26 PM   #1
Member (10 bit)
 
Kareeser's Avatar
 
Join Date: Mar 2006
Location: Toronto, Canada
Posts: 810
XHTML function similar to PHP includes?

Seems like I ruined the other topic by using the tag "iframe". Can a mod please delete it please?

Hello all...

Been dabbling in XHTML 1.0 ever since I discovered it. Quite handy, and makes web development fun again. One thing I've noticed is that while my styles are all based on CSS (another fun development), if I change the content of, say, a menu bar, I still have to go and edit every single html page on my website to change the menu bar.

I know PHP has the "include" function to include bits of other scripts in the parent script...

and I know I could probably make something work out of XML and XSLT, but it does look rather complex...

Is there something I can do in XHTML that doesn't involve the use of "object" or "iframe"?

Last edited by Kareeser; 04-03-2007 at 09:53 AM. Reason: removed extra bit in totle, spellcheck
Kareeser is offline   Reply With Quote
Old 04-03-2007, 09:21 AM   #2
Staff
Premium Member
 
mairving's Avatar
 
Join Date: Jul 1999
Location: Arlington, TN
Posts: 5,538
Thread deleted.

Build an external stylesheet and link it.
Example: <link href="URL.css" rel="stylesheet" type="text/css" />
__________________

Want to Make $$$$ with your Computer? No Risk! Simply press shift-4 four times in a row
mairving is offline   Reply With Quote
Old 04-03-2007, 09:49 AM   #3
Member (10 bit)
 
Kareeser's Avatar
 
Join Date: Mar 2006
Location: Toronto, Canada
Posts: 810
Hm... I was under the impression that using an external stylesheet was only good for separating form and content, which I've already done...

I also thought you couldn't (or rather, "shouldn't) put content in an external style sheet...

Some more detail about what I want to achieve:

menu.html
Code:
... some code for a menu
index.html
Code:
code for the menu     <-- dynamically added to the page

additional page content
I may be heading into dynamically generated content here...

Last edited by Kareeser; 04-03-2007 at 09:57 AM.
Kareeser is offline   Reply With Quote
Old 04-03-2007, 10:23 AM   #4
Staff
Premium Member
 
mairving's Avatar
 
Join Date: Jul 1999
Location: Arlington, TN
Posts: 5,538
Sorry I misunderstood your question.

Includes with php would be the way to go. A very simple way would be to build your menu then separate out that part of the menu into a separate file commonly called menu.inc (the extension doesn't mean anything, it just tells you that it is an included file), then include it:


<?php include("menu.inc"); ?>


That is a very simple approach. An overall better strategy is to design your site, then hook it up to a CMS like Joomla. That way you have dynamic menus, pages and a whole bunch of other stuff.
mairving is offline   Reply With Quote
Old 04-03-2007, 01:20 PM   #5
Member (10 bit)
 
Kareeser's Avatar
 
Join Date: Mar 2006
Location: Toronto, Canada
Posts: 810
Ah, I can't believe how simple it is to use...

Reduced my index page from 30k to under 1k

Thanks!

Next problem... every time I change an included page, php spits out an error saying the file no longer exists... I think it has something to do with page caching, but I could be wrong... any help?

Last edited by Kareeser; 04-03-2007 at 01:50 PM.
Kareeser is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
WD 500 GB hard drive TwoRails Computer Hardware 2 09-12-2006 08:56 AM
Computer Acronyms Floppyman Computer Hardware 156 06-18-2006 06:25 AM
Post-install script for dapper drake rightcoast Linux OS and Software Assistance 2 06-05-2006 08:30 PM
Overclock Suggestions? ShannonLi Computer Hardware 9 08-04-2004 11:24 AM


All times are GMT -5. The time now is 07:27 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2