SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member Bhanu_Pratap's Avatar
    Join Date
    May 2012
    Location
    Jaipur, Rajasthan, India
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question need help in html wesbite

    Hii all,

    i don't know it is the right category to post this thread or not but it is related to web design so i am putting my query here.

    My trouble is:

    I have a website thoughtfulminds (dot) org, It is completely made in HTML and out of 94 pages 90 are indexed in Google. Now since this website is in HTML if now i have to make any changes like i have to add any services or change any link i have to get all the pages in Dreamweaver and do the changes in header or footer section.

    So, i want to make a header and footer file and want to include it in my website. I have tried several ways like used object tag but it creates scroll bar and is now worth using.
    Secondly i also used <!-- include virtual ...> this tag but it also didn't worked for me.

    So i want to know how can i make a header and footer file and include it in my HTML pages ????

    Regards
    Bhanu

  2. #2
    Avid Logophile silver trophy
    ParkinT's Avatar
    Join Date
    May 2006
    Location
    Central Florida
    Posts
    2,282
    Mentioned
    180 Post(s)
    Tagged
    4 Thread(s)
    The SSI (Server Side Include) should work for this; depending upon your server configuration.
    Of course, this will still require loading/editing every single page in order to apply the changes.

    Double-check the way you implemented (or tested) the SSI. Here is a good example I found from a web search.
    Don't be yourself. Be someone a little nicer. -Mignon McLaughlin, journalist and author (1913-1983)


    Literally, the best app for readers.
    Make Your P@ssw0rd Secure
    Leveraging SubDomains

  3. #3
    SitePoint Member Bhanu_Pratap's Avatar
    Join Date
    May 2012
    Location
    Jaipur, Rajasthan, India
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, you are right i was talking about the SSI method it looks promising but i tried this method it didn't worked for me
    what could be the reason for this?? Why this method not working in my website

  4. #4
    SitePoint Member
    Join Date
    May 2012
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi there,

    I know that you already have your pages in html format but I would suggest you convert it to PHP pages since you can just add some PHP script to it later on if you decide to and therefore make your site more future proof. You would also be able to use the code <?php include 'navbar.php'; ?> to each of your pages and just edit one file if you want to make a change on your navigation bar for example.

  5. #5
    SitePoint Addict kduv's Avatar
    Join Date
    May 2012
    Location
    Maui, HI
    Posts
    211
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Assuming your server is running Apache and PHP, you can tell your server to parse all your .html files through PHP without changing all your file extensions.

    Just add the following line in your root .htaccess file (depending on whether your PHP install is running as an Apache module or CGI mode):
    Code:
    # If PHP is running as a module
    AddType application/x-httpd-php .html .htm
    
    # If PHP is running in CGI mode
    AddHandler application/x-httpd-php .html .htm
    After you add the appropriate line, all .htm and .html files will be executed the same as if they were .php files. From there you can insert your headers and footers in your existing HTML files like so:

    PHP Code:
    // somepage.html
    <html>
    <head> <!-- HEAD CODE --> </head>
    <body>
    <?php
        
    // Include your custom header file
        
    include('header.php');
    ?>
    <!-- Body Code -->
    <?php
        
    // Include your custom footer file
        
    include('footer.php');
    ?>

    </body>
    </html>
    Then just create header.php and footer.php with whatever HTML you want inside, IE: navigation links, footer links, etc.


Bookmarks

Posting Permissions

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