alykhalil
(regular)
Tue Mar 22 2005 03:36 PM
minor help with my website please?

can anyone pls help me with the below :

I am enroute building my website for leisure purposes which will have about 5-6 pages. Now...

as we all know that all the 5 to 6 pages will have the same links on all pages only the data on all pages will/might change. fair enough.

But..which is the best way to keep all the links on all pages the same and only keep changing the data on those pages when needed. In other words, if i add 1 link in 1 page and want the same link on all pages, how do i go about that ?

is there a way that by updating a particular link on all pages ?
there might be a free software or something like that.

i do have a domain, webspace provider etc.

right now what i am and have done is, i made the home page with data and links, uploaded it on my webspace provider's server. then i made the contact us page and did the same. thats just 2 pages. ..now i need to change some links on the home page. so i will have to change them on the contact us page as well. is there an easier option ?

pls advise. highly appreciate

thank you



asterix
(regular)
Tue Mar 22 2005 05:41 PM
Re: minor help with my website please?

Frames may be an option, you create one page called something like frameset.html, in that page, you include:

<frameset cols = "250,*" border = 0>
<frame src = "naviframe.html" noresize scrolling = "no">
<frame name = "mainframe" src = "home.html" noresize>
</head>

this will create a page with 2 frames, one with naviframe.html and one with your home.html, for more info about fames try this excellent site.

in the naviframe, you include this line:

<base target = "mainframe">

now all the links in the naviframe will change the page in the mainframe section.
Not everyone likes frames for some reason, I personally think they are really useful. But another option might be a javascript file.

in all your web pages create a div called navi, eg:

<div id = "navi"></div>

you can learn about how to use divs here.

you then create a .js file called navi.js and include script like this:

function navi()
{
navi.innerHTML += "<a href = 'home.html'>Home</a>
";
navi.innerHTML += "<a href = 'gallery.html'>gallery</a>
";
navi.innerHTML += "<a href = 'jokes.html'>Some Jokes</a>";
}


in all your html files add:
<html>
<head>
<title>Hello</title>
<script type = "text/javascript" src = "navi.js">
</head>
<body onload = "navi()">
Hey and welcome to my website
<div id = "navi"></div>
</body>
</html>

the above html page should now include the three links in the navi div.

Now all you have to do to change the links is to add a line to your navi.js

Hope this has helped, any problems just ask.

Asterix


alykhalil
(regular)
Tue Mar 22 2005 06:04 PM
Re: minor help with my website please?

hi asterix...

i am very sorry i forgot to tell you that i am a dummy when it comes to web designing...all i do is grab codes from here and there and change them to how i want. so what you mentioned, is brilliant, but it just flew above my head.

sorry. pls let me know a dummy's guide if possible...

i am presently using a div option which has a css as well.



predator
(regular)
Tue Mar 22 2005 08:07 PM
Re: minor help with my website please?

I'd suggest you ignore the frames suggestion - this is very poor web design practice, and should really be avoided.

For 5 or 6 pages, its probably easiest to just manually update each page - edit one page then copy and paste the new html into the other pages.
For larger sites then you can look at other options, but for the monet you're best sticking with the simple option.
http://www.predatorconservation.com


alykhalil
(regular)
Tue Mar 22 2005 09:03 PM
Re: minor help with my website please?

well mate, since my 1st post, not 5,6 but i have reached 16,18 pages but i think manually wud still be the right choice...wudnt it ? cheers


Nanook
(regular)
Wed Mar 23 2005 12:14 AM
Re: minor help with my website please?

Does your sever support SSI or PHP?
*Nanook
http://www.bains007.co.uk


alykhalil
(regular)
Wed Mar 23 2005 08:44 AM
Re: minor help with my website please?

hello...yes...my server supports SSI & PHP ?

thank you


alykhalil
(regular)
Wed Mar 23 2005 09:09 AM
Re: minor help with my website please?

i just wnt to the "myphpadmin" section of my webspace provider.....gosh...there you got enter info like field, type, VARCHAR, values, attribute, null, default....all flying above my head.... hehe but if i am told i am positive i can do it... thank you


Nanook
(regular)
Wed Mar 23 2005 07:04 PM
Re: minor help with my website please?

You can use either SSI or PHP to include a seperate html file.
If you use PHP then the code is

<?php include(page.html); ?>

So save the navigation file (nav.html for instance) and then on each page tell it to include nav.html.

The same applies for SSI, with some different code


Nav.html should not have head, body tags, only the HTML you want to be added to the page it will be included in.
Place either of the above where you want the file to be shown.

*Nanook
http://www.bains007.co.uk


ianm
(regular)
Thu Mar 24 2005 12:44 AM
Re: minor help with my website please?

ssi (server side includes) is the way to go as the above post mentions.It is really very easy i will try a step by step explaination that i hope makes sence,

1, First off pick just one page to practice with incase things go wrong, now change the extension of this page from .htm to .php ie contactus.php, (the reason for this is so that the server knows there will be a bit of php code to execute.)

2, Now create a new folder and name it includes, you will upload this to the same place as all webpages.

3, Now open the webpage up in notepad or whatever program you like and find the nav table, highlight all of it and then cut it out the page, now paste the nav table into a new notepad document and name it nav.php save that into the includes folder.

4, The section of the webpage you cut the nav table from can now be replaced with this piece of code
<?php include("includes/nav.php") ?>
thats it, when the server sees that line of code it reads whatever is on your include file in this case your nav menu and inserts it back in place before sending the page out to the user, so nobody will ever see the line of php code but just see the nav menu as normal, if this works ok you can then repeat the process on all your pages and then you only need to make changes on your incude file and it will be reflected across the whole site.
If you look at the code it is very self explanitary. Once you have done 1 page and have it working your realize how easy it is.

Hope that's of use.

Regards
Ian


Contact Us | Privacy statement Main website
Hitwise Top 10 Award Winner - Jan-Mar 2005

About us | Contact us | Link to us | Terms & Conditions | Privacy Policy
© Copyright IPC Media Limited, All rights reserved