HTML FOR FRAMES

  SolvaCollective 10:41 25 Jun 03
Locked

HI guys, im trying to create a frame within my site. However my html coding to make a frame doesnt seem to work. All I get is a message saying cannot open page file for both pages.

Heres my HTML

frameset cols="135,*" frameborder="0" border="0">
frame name="left" src="aboutus.htm">
frame name="right" src="contactus.htm">
/frameset>
/html>

Any Ideas

  Agricola 12:07 25 Jun 03

I assume you are omitting the < at start of each tag for this post.
If you are getting cannot open page errors this sounds like you have incorrectly entered the file name or path.

File names are case sensitive. If you called something Myfile.htm then call it as myfile.htm it wont load. Also a common mistake is to forget which extension you are using, are you using .htm or .html ?



Is the frames code page saved in SAME directory path (Folder) as the files you are trying to load? If not you have to enter the proper path eg src=?/htmlcode/filename.htm? in this example it will load a file filename.htm in the folder htmlcode in the main root directory.

Leaving of the leading / you are saying that the file is located in a the folder htmlcode which is located in the same folder as the file its read from.

I prefer to call full paths from root directory because when any files are moved around I don?t have to change any code.

I assume you have a general knowledge of directory (folder) paths, but will give it a very brief mention now. If you still need any help with paths I or someone else can explain better.


From a design point of view Frames are very outdated now for a number of reasons to do with browser compatibility, pages getting trapped in frames and other funny quirks. Personally I think that Frames also look ugly, and make the page feel heavy going.

For small sites with not many pages using a table will be better, however if you are producing hundreds of pages and then want to change the menu its going to be a nightmare.!

So this is where PHP comes in. This not as hard as it may seem you still can use 99.9% of your site in HTML, a simplified way to use php is :

<table><tr><td>
<?php
$include_path = dirname(__FILE__);
include $include_path.?indexpage.htm?;

?>

</td><td> your html code as normal here</td>
</tr></table>

now all you have to do is save it as .php instead of html and all you have to do is create 1 html code for your menu. Please note you will not have to include any <html tags etc, as the php will paste into the table.

Anyway I?m getting side tracked now but this is a good option to take and is worthwhile and may give others looking an idea.


ANYWAY if you still have problems with your frames and it is not a path issue dont hesitate in asking
Thanks

  Agricola 12:09 25 Jun 03

for some reason my quotes are comming out as question marks!

in above take all Qeustion Marks as the double speech mark quote. APART FROM THE <?PHP and ?>

  TechMad 12:12 25 Jun 03

Your HTML should read something like:

<html>
<head>
<title>[Your title]</title>
</head>
<frameset cols="135,*" frameborder="0" border="0">
<frame name="Left" src="aboutus.htm">
<frame name="right" src="contactus">
</frameset>
</html>

Does this help?

  TechMad 12:15 25 Jun 03

Is your website on a server that is PHP enabled? I'm not quite sure where PHP comes into frames. I thought PHP is more for dynamic content, i.e. reacting to specific user input.

  TechMad 12:19 25 Jun 03

Frames can look ugly, but they can be customised to good effect. I'd use as fewer fames as possible (2 or 3 at most) as pages can become hard to navigate.

  TechMad 12:21 25 Jun 03

By the way "<frame name="right" src="contactus">" should read:

<frame name="right" src="contactus.htm">

  Agricola 12:50 25 Jun 03

yes I forgot to mention that php needs to be enabled i just assume that all hosting nowadays have php, unless of course you are using a free hosting like geocities etc.

PHP is a powerful language and is a joy to work with, just because you can do dynamic things and so on with it doesn?t mean you can exploit the odd php command to spice up your html.

Many sites now use php includes, like my example, to display their menu bars, headers and footers. This is same principle as frames but more flexible and makes the viewing more friendly and eliminates all the problems which come with frames, thus producing better results than frames. And also enables you to alter just one file which will then be loaded by all the others.

As for the example I gave this is an ALTERNATIVE to that of using left and right column frames.

If you wanted a header to appear on every page you simply put your php include code this at the start of your html code and at end of it for footer.

I not telling you to use this I?m just giving it as an example of what is now standard practice in website design.

oh and if you go hunting for php in source code you will never find it as its all processed server side and spewed out to browser. and never shows up when you do right click view source code.

  SolvaCollective 20:01 25 Jun 03

Guys thanks for your input its been outstanding. But lets sidestep my intial query for the moment and move on to something you raised. PHP! Its far from imperitive that I use frames, Infact the only reason im using it is I thought it help structure my site. I was trying to construct my pages with Tables but was having problems doing so. So the frame was just going to replace the table that I couldnt create. The data in the frame or possibley table wont it change it is just the site menu with the all the major links to parts of my site. So how could I go about creating this without a frame.

Thanks all

  tbh72 23:56 25 Jun 03

It's getting late, so not sure if your about..!!! What html editor are you using for your websites construction?

  Taran 20:42 27 Jun 03

What exactly is the layout you are trying to achieve ?

Can you describe it in terms of which page elements you would like, where on the page you would like them to appear and so on ?

PHP is all well and good and does a lot of things for a lot of people. If you can't get a reasonable layout using HTML or a WYSIWYG web editor though, I can't really see what PHP can offer you unless someone simply gives you some copy and paste code.

I guess all I'm trying to say is that I see little point in trying to learn two web languages when one is proving problematic on its own.

Just having a PHP enabled host is not all you need. Without a general overall understanding of PHP; what it is, how it works, what the code means and how to write it, you'll be as helpless as a fish out of water.

Plain old HTML is still the core of the majority of standard websites and despite moves to replace it, it still is and will continue to be the mainstay of web pages for quite some time.

Rather than argue the suitability of one language over another though, it would be more appropriate of me to examine the layout you are trying to arrive at and see if one of us can help you get there using more conventional means.

You could do worse than look at the following two links. I am not suggesting that you use someone else's work for your own site, but it can sometimes help to see the code that makes up those problem areas of a page along with any spacer images and similar features, to allow you to construct your own pages the way you want them.

click here

click here

Try and describe what you are heading towards and one of us will make a stab at getting you there.

Regards

Taran

This thread is now locked and can not be replied to.

Nintendo Switch review: Hands-on with the intuitive modular console and its disappointing games…

1995-2015: How technology has changed the world in 20 years

This abstract video touches on division in our technologic world

Best alternatives to iTunes for Mac | Best music players for macOS: Free your music from the…