Results 1 to 10 of 10
  1. #1
    Join Date
    Mar 2003
    Posts
    70

    Sidebar? include code? Help please!

    I am re-designing my website. I am not some very good web designer so I do it in plain html. This time, I have gotten into a problem. I want to have a sidebar menu for all my pages. But I want it to be in some sort of "include" method so that when I edit the sidebar menu page, all others get updated automatically.

    I have done this for the header and footer but I don't know how to do it for the sidebar. Can anyone help me out? Please!

  2. #2
    Join Date
    Mar 2003
    Posts
    70
    come on guys... it must be a piece of cake for u guys.... please let me know about it ASAP

  3. #3
    Join Date
    Apr 2002
    Location
    Southern Maryland
    Posts
    246
    Do you mean this?

    Code:
    <div id="sidebar">
    <?php include("/path/to/your/sidebar.php"); ?>
    </div>
    Sara

    Sara Nelson Photography Preserving your moments since 1973.

  4. #4
    Join Date
    Mar 2003
    Posts
    70
    is dat in html or php?
    i want an html code...

  5. #5
    Join Date
    Apr 2002
    Location
    Southern Maryland
    Posts
    246
    It's for a php include, but you can use it in an html document.
    Sara

    Sara Nelson Photography Preserving your moments since 1973.

  6. #6
    Join Date
    Mar 2003
    Posts
    70
    oh thanks... can you please tell me the html include one? If you don't know it, I'll try figuring this out but if you do, please let me know because this one is a bit confusing

  7. #7
    Join Date
    Apr 2002
    Location
    Southern Maryland
    Posts
    246
    Sure, first make your sidebar.php file in a .txt (Notepad) file. Then, put the following in your .html document where you want the sidebar.php to show up:
    Code:
    <?php include("/path/to/your/sidebar.php"); ?>
    Where it says /path/to/your/ use the absolute path such as

    /home/username/public_html

    This will only work if your host supports PHP though.
    Sara

    Sara Nelson Photography Preserving your moments since 1973.

  8. #8
    Join Date
    Jul 2003
    Location
    Castle Pines, CO
    Posts
    7,189
    You also might consider SSI - server side includes. You save your main page with SHTML or SHTM. This tells the server to parse this file before delivering it to the browsers. 99% of all hosts support SSI

    More information:
    http://www.bignosebird.com/ssi.shtml
    http://www.smartwebby.com/web_site_d...e_includes.asp

  9. #9
    Join Date
    Mar 2003
    Posts
    70
    You mean I can code, etc my page in html put just rename it to .shtml or .shtm?

    By the way, thanks a lot you guys. I have figured out how to do it now and yes, my server supports php and SSI both.

  10. #10
    Join Date
    Apr 2002
    Location
    Southern Maryland
    Posts
    246
    You are welcome...glad you have it figured out.
    Sara

    Sara Nelson Photography Preserving your moments since 1973.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •