FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

so, this is what I want to do... help needed

 


Mamsaac
ok I have my site... www.mamstuff.tk

now, if you see it, it has the same design on almost every single hyperlink, but the problem is one:

if I want to delete anything from the body (not background and all that stuff, already put it on .css) I have to change every single .htm file.

there's only one part of the site that continuously changes (the middle TD).

is there a way to be able to put html code on a script so that I can change the buttons, links, etc, easier and yet being able to change the "changeful" part of the site directly from the html file?

I hope I made myself clear... english isn't my first language.
wumingsden
Mamsaac wrote:
ok I have my site... www.mamstuff.tk

now, if you see it, it has the same design on almost every single hyperlink, but the problem is one:

if I want to delete anything from the body (not background and all that stuff, already put it on .css) I have to change every single .htm file.

there's only one part of the site that continuously changes (the middle TD).

is there a way to be able to put html code on a script so that I can change the buttons, links, etc, easier and yet being able to change the "changeful" part of the site directly from the html file?

I hope I made myself clear... english isn't my first language.


use a php include function
Mamsaac
ok, I will make some research on that. Thanks.

if I have any doubts, I will post them in this topic later.
wumingsden
Mamsaac wrote:
ok, I will make some research on that. Thanks.

if I have any doubts, I will post them in this topic later.


Its not hard. Change all html extensions to .php and then create a file, like body.php which will contain the main site content. Then, include the page in a .php file to where the file is located, for example,

Code:
<?PHP
include("body.php");
?>


I have done something similar to this at my site. I have a header, footer, navigation, etc which are all includes. It seems that your looking for the reverse effect, whilst I want different main content on each page you want the same main content on each page.
Hojo
if i understand you right you want to have the menu in a way that you only change 1 thing and it gets updated on all pages. i had this prob before with my website and the best way to solve it is, as said above the include function in php.

if you do not want to use php, or want to keep your pages .htm you could also make an iframe for the menu.
Code:
<iframe src="menu.htm" width ="125" height ="300"></iframe>

like with tables you can set further properties like no border, margin etc. and also no scrolling

the problem with iframes is if you add a new button to your menu, theres a chance that the set height isnt enough and you'll get a scrollbar that screws everything up. in some cases i prefer iframes, in button excanges etc. but for menus, header, footer etc. i would go with the php include function
Mamsaac
I've heard there are problems with frames when it comes to google.

I will do the include function tomorrow, thanks.

do I need much knowledge on php for that?
rafifaisal
No No people.
All above solutions are ok.
But to this the easiest way is with CSS.
just create a style.css file in your webroot with all the info in it.
All pages will react like this.
Mamsaac
but, if I understand correctly, if I wanted to make it on css, I would need to do the code all over again. if I use php, I just have to make the files and I can copy-paste the htmls by using echo, which will be faster, no?
DoctorBeaver
rafifaisal wrote:
No No people.
All above solutions are ok.
But to this the easiest way is with CSS.
just create a style.css file in your webroot with all the info in it.
All pages will react like this.


CSS is for presentation not content.
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.