...

View Full Version : need to save time



dimeuleh
11-27-2007, 06:26 AM
I need to make it so that top half the page which includes the menus
and few things that will be changed often to be separate to the rest of the page.

So what i mean is when someone clicks the links on the top half of the page within the banner etc only the bottom half of the page changes.

I want this so i can edit the top page adding and deleting links etc without having to do it to every single page.

Can someone link me or explain the easiest way to do this.

abduraooft
11-27-2007, 06:56 AM
Write the code for your navigation in a separate file and by using some server side script, include them wherever required.

srule_
11-27-2007, 03:16 PM
This is easy. It requries PHP but nothing hard. Just make sure your web host supports PHP. If not you will need to use wtv language they support.

What to do:

1) Copy paste the "Header" code from the orginal file and put it in a new file and name it "header.php".
2) Delete the "header code" from the original file and replace it with


<?php
include (header.php);
?>

3) Re-save this file as a php file (not html).

Now you header is in one file :-)

To make it easier to manage I would make an "includes folder" with all the stuff u include, ex: header, footer, sidebar, ext...

harbingerOTV
11-27-2007, 11:08 PM
to piggy back on sRule you can do this in Cold Fusion, ASP and .NET as well:

ASP


<!--#include file="header.asp"-->

.NET


<!--#include file="header.aspx"-->

Cold Fusion


<cfinclude template = "header.cfm">


that is if your site is not PHP.

dimeuleh
11-28-2007, 05:41 AM
i had a go doing it. using ssi

saved the page as pagename.shtml

and put the code

<!--#include virtual="header.html"-->

didn't seem to get the result i wanted.
will attempt the php way

dimeuleh
11-28-2007, 12:07 PM
okay i got a problem

i get this error on my page were the header is meant to be


Warning: main(headerphp): failed to open stream: No such file or directory in /hsphere/local/home/alexin11/moreleadsandcustomers.com/contactus.php on line 111

Warning: main(headerphp): failed to open stream: No such file or directory in /hsphere/local/home/alexin11/moreleadsandcustomers.com/contactus.php on line 111

Warning: main(headerphp): failed to open stream: No such file or directory in /hsphere/local/home/alexin11/moreleadsandcustomers.com/contactus.php on line 111

Warning: main(): Failed opening 'headerphp' for inclusion (include_path='.:/usr/local/lib/php:/usr/local/share/pear') in /hsphere/local/home/alexin11/moreleadsandcustomers.com/contactus.php on line 111

VIPStephan
11-28-2007, 12:35 PM
Obviously the file you’re trying to include is missing (i.e. not uploaded?) or the path is incorrect.

dimeuleh
11-28-2007, 01:16 PM
but the header.php is in the same directory?

abduraooft
11-28-2007, 01:51 PM
Lol, its header.php not headerphp, an innocent message from parser!

dimeuleh
11-28-2007, 10:11 PM
I have put

<?php
include (header.php);
?>

_Aerospace_Eng_
11-29-2007, 03:44 AM
You need the quotes

<?php
include ('header.php');
?>

dimeuleh
11-29-2007, 03:52 AM
worked. thank you !



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum