anwiii 17 Report post Posted May 1, 2009 i'm looking for a way so that i don't have to edit all web pages if i have something to edit that is on all my web pages.would this be css? i don't know much about it. obviously the content would be saved in a different file and called in. in any case, i would like an example to view of the code and how to impliment this within the html file Share this post Link to post Share on other sites
jlhaslip 4 Report post Posted May 1, 2009 Something like a Menubar or Header/Footer?Check out php "includes" which will grab a file (html/php/text, etc) and plunk it into the calling page.*wait*check the tutorials here on the Xisto... start with this one, maybe: http://forums.xisto.com/topic/35271-templating-system-using-php-includes-building-a-dynamic-site-using-includes-and-flat-files/ Share this post Link to post Share on other sites
rvalkass 5 Report post Posted May 1, 2009 The alternative is to use server side includes (SSI). This is the same as the PHP method, but just doesn't need PHP. It's also fairly simple to do.First, make sure you name your files with the .shtml file extension if you haven't already started your site. If you have, and the files already have a different extension, we can work around this. Then, use this code to insert a page into the normal flow of your HTML: <!--#include virtual="filename.shtml" --> So, for example, you could have the following markup: <html><head> <title>Page</title></head><body> <!--#include virtual="header.shtml" --> <!--#include virtual="news.shtml" --> <!--#include virtual="sidebar.shtml" --> <div id="content"> <p>This is unique page content for this page.</p> </div> <!--#include virtual="footer.shtml" --></body></html> Share this post Link to post Share on other sites
webishqiptar 0 Report post Posted May 1, 2009 (edited) Well it would be better to create a footer, a header, and include it in all pages. Then in the header <head> section you could place a link to an external sheet file of css: <link rel="stylesheet" href=style.css screen="media" /> Edited May 1, 2009 by webishqiptar (see edit history) Share this post Link to post Share on other sites
anwiii 17 Report post Posted May 1, 2009 ok- thanks for the tips. the ssi's(html &php) was what i was lookin' for. i never used them before. i practiced with it a little last night. i think it's about time i learn css as well...will come back to this thred when i have other questions. thanks again Share this post Link to post Share on other sites
kleong 0 Report post Posted May 1, 2009 Depends on what you want to change. Css might not be able to do it. Beside SSI and PHP, you might also want to consider javascript. In the javascript file, you can do a document.write to "write the html". Share this post Link to post Share on other sites
anwiii 17 Report post Posted May 2, 2009 yea, js was something else i was looking in to, but i think i'll stick with the ssi for now...thanks for reminding me. i need to learn a little js soon too for other things.... Share this post Link to post Share on other sites
Jonnyabc 0 Report post Posted May 5, 2009 Obviously, PHP (or ASPx) is the best way to go for dynamic server-side web pages. However, if you are only a beginner, it is recommended to learn CSS, then add on to that via JavaScript, and finally something like PHP. Currently, I'm in the second to third stage; if I ever get the opportunity to learn PHP in a realworld environment, I'll start immediately. Also, because you are using scripting programs such as PHP, make sure that you are using XHTML, which is slightly more refined for programming purposes. Sincerely, Jonnyabc Share this post Link to post Share on other sites