PDA

View Full Version : design issue anyone help


kaiiak
01-20-2006, 12:50 PM
i made website using iframes so the navigation bars are all constant and link to iframe... so when i clicked on link it just loaded in the iframe..... but the address at top didnt change cos it was in iframe....

so i wanted to make it so that each page was independant, so ive put the navigation bars on all pages and no iframes....

the problem is that if i want to change navigation bar now i have to change it on about 50 pages.... what do u suggest i should do...?

should i use an iframe just for navigation bar or is there a way of making a template that includes the navigation bar or something.....

mark87
01-20-2006, 02:04 PM
You could use an iframe for the navigation bar but it's not recommended.

Look into using server side includes (http://www.webreference.com/programming/ssi/intro/). You can either do them as mentioned in that article and save your files as .shtml, or what many people do, and just save your files as .php, and use this for the include -

<?php require("navigation.html"); ?>

Or -

<?php include("navigation.html"); ?>

kaiiak
01-20-2006, 04:41 PM
problem is, i couldnt get

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

working in my html files.... it just doesnt read it and leaves a blank space even though the .php file alone works fine, so id have to convert all my files to .php which id rather not...

can any1 explain why the above code wouldnt work in html or how to fix it....?

mark87
01-20-2006, 04:44 PM
Because your server is seeing .html, and therefore reading it as HTML not PHP.

You could use AddType in your .htaccess to make the server read .html files as .php -

AddType application/x-httpd-php .html

kaiiak
01-20-2006, 04:47 PM
i dont have a .htacces file at moment....

and i dont want to password protect site
if i just create .htacces and put

that line inside it is that all i need?

mark87
01-20-2006, 04:48 PM
Yes create a file called .htaccess (two s's!) and place it in the root directory. In it place the line I told you in the above post.

.htaccess is not just for password protection.

kaiiak
01-20-2006, 04:55 PM
"Filenames may only contain the characters 'a-z', 'A-Z', '0-9', '-', '_', and '.' and may not start with a '.' "....?

mark87
01-20-2006, 05:01 PM
Open up Notepad, type in the line, File>Save As... > choose All File Types > enter in .htaccess for the filename. Should work.

kaiiak
01-20-2006, 05:03 PM
"The .htaccess file can be used to create custom error pages and web page redirects, set up password protection, enable SSI, and more. Yahoo! does not currently allow you to upload .htaccess files to your account. For other customization options, we recommend the Custom Error Pages and password-protection features available in your Web Hosting Control Panel. "

:mad:

is there no other way seems that my host doesnt allow .htaccess files...

mark87
01-20-2006, 05:04 PM
Nope no other way that I know of then :o . Get some new hosting ;) .

kaiiak
01-20-2006, 05:06 PM
:mad:

only just got this one... what else would u recommend.. apart from
making everypage a .php file...... is there no javascript or asp that any1 knows that can do the same thing...?

do .php get treated in exactly same way as .html by search engines and stuff?