Jump to content

A little question


The Sea King
 Share

Recommended Posts

Guest FirefoxRocks

I highly recommend using PHP or ASP includes as suggested above but you can do it with iframes too (but I do not recommend that since <object> doesn't work properly in IE and <iframe> is deprecated).

Link to comment
Share on other sites

1:Do we have to put the exact url of the file?
Relative URLs are fine.
2:How do we do Iframe?
<iframe src="menufile.html" style="height:500px; width:200px; "></iframe>

But a server-side solution is far better.

Link to comment
Share on other sites

If you're able to use a server-side language like PHP, that would be much much much betterIf you have you're menu in an iframe...well, that just sucksIt's not even 100 % sure that spiders/bots will be able to click on your links in the menu if you have it in an iframe

Link to comment
Share on other sites

Forget the <iframe>, I don't recommend it at all.Try this:<?phpinclude("file.html");?>And inside file.html you could have a menu, for example like this:(You don't need <html> <head> or <body> tags, just the menu code)

<ul id="menu">   <li><a href="URL">Link</a></li>   <li><a href="URL">Link</a></li>   <li><a href="URL">Link</a></li>   <li><a href="URL">Link</a></li></ul>

Link to comment
Share on other sites

For example if test.php is in one folder and menu is in another, such as this diagram:

		   root directory				|		-----------------		|			   |	  folder		file.html		|	 test.php

Then in test.php you'd write:<?php include("../file.html"); ?>

Link to comment
Share on other sites

I haven't seen it there, it's just something I've known for years, because I used to use it to navigate through folders in a very old computer of mine.../ means parent directory while ./ means current directory (which is the same as not putting anything at all).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...