04-03-2009, 05:04 PM
Hello. I was wondering if there was a way I could make a webpage import html from another file into a page. E.g.
This will make it ALOT easier to maintain and update. And will make the code on the main page much easier to see, because I want to add a lot of images. I know that forums use php to call in different style sheets. Something like @import.
04-03-2009, 05:20 PM
If you have a php or some other serverside support, it's very easy.
But the above code should be in a page having a .php extension, otherwise you'd need to add some htaccess rules to for your server to treat your html files like your php files
04-03-2009, 05:23 PM
Do you know what htaccess rules I need to add. And where do I put that php code? Because I want it to add the other files in certain places. Well, In a table.
So would I add
Between the <td></td> tags?
04-03-2009, 05:36 PM
Between the <td></td> tags? Yes, if it's in a php file,
<td><?php include "1.html";?></td>
<td><?php include "2.html";?></td> should work.
PS: Do you know why tables for layout is stupid (http://www.hotdesign.com/seybold/)?
04-03-2009, 05:53 PM
I have seen that website to many times Lol. I know tables are bad, but I am a very basic coder Lol. I cant be bothered learn stuff like that yet.
Could I just save my page as a php file like it is? Or would I have to change stuff about?
04-03-2009, 06:49 PM
if you change your page extension as .shtml yo can include another file into your page
use that code to include a file:
<!--#include file="addedfile.html" -->
for more info about shtml click here (http://en.wikipedia.org/wiki/Server_Side_Includes)..
04-03-2009, 09:36 PM
You only need to work with the htaccess file if you are changing the way the HTML documents are served. If you're using plain PHP (as in "page.php" instead of "page.html") you won't have to bother with the htaccess file at all.
04-03-2009, 11:24 PM
I will probably be using x10 hosting, they have php. It is all working now as well. Thanks people.