In your sidebar.htm
file, try removing the target
attribute only supports the following values:
- frame name
value tells the link to navigate to the URL specified in the same page (i.e. - no tabs or no new windows) and this is usually the default value. You may already know what the _blank
value does, but that opens a new tab or new window (depending on the browser). The other three aren't really that common, so I won't go into depth on that. But, you can check out more information here
What you're doing is specifying a name for a different frame. However, if that frame is on another page, it won't load the content in the same document. If there is no frame at all, then there's really no point. Plus, all you're doing is linking to a different page so a frame wouldn't really be important if you're only using one for your sidebar. Also, you don't need to include a full document if you're just linking the frame to a sidebar (i.e. - you don't need all the header and footer tags, just DIV and anchor tags and the sort).
However, I suggest you use a PHP include if it's for something so simple. To do that, though, you need to edit your pages to have a .PHP
extension as opposed to your .HTM
(HTML) extension. Then, you have to create a PHP file to store the things in your sidebar and after that, just add this code wherever you want to show your sidebar.
$path = realpath($_SERVER['DOCUMENT_ROOT']); // Gets the root (index) path for a clean include, so to speak.
include ($path . '/sidebar.php'); // This gets what is inside your PHP sidebar file. Keep in mind that you may have to edit the rest of the path depending on where your PHP sidebar file is at.
This may seem like a little extra effort, but it's good for a tiny bit of experience or to get you interested in learning a new syntax. Additionally, .HTM
extensions are sort of out-of-date.
Feel free to ask any more questions you may have. Otherwise, good luck.