Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12
  1. #1
    New Coder
    Join Date
    Nov 2011
    Location
    India
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Help with external Html

    I'm currently making a banner which has the nav bar on it. I made image from Photoshop and then I made different link space by image mapping. So I pasted that code on each and every page of my website. Now while doing that one thought came to my mind that, whenever I have to edit it I just can't go and edit each and every source code on each and every page. So the idea of using a external code and a single link in source code came in my mind. But I don't know how to do it. I googled and refereed to this http://www.javascriptkit.com/howto/ssi2.shtml
    But something went wrong....
    Will anyone help me in this?
    Last edited by Sharkhead; 11-11-2011 at 08:29 AM.

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello Sharkhead,
    Maybe a better/different tutorial would help - http://www.tizag.com/phpT/include.php
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    New Coder
    Join Date
    Nov 2011
    Location
    India
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm unable to understand it.
    Would you explain it?

  • #4
    New to the CF scene
    Join Date
    Nov 2011
    Posts
    9
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Excavator View Post
    Hello Sharkhead,
    Maybe a better/different tutorial would help - http://www.tizag.com/phpT/include.php

    As excavator said use a little PHP and you are done let me explain the example he has given



    say you have two php files namely : one.php and two.php


    in one.php you have written code


    echo"hello";


    and in two.php you have written

    echo"how are you ? " ;



    now in two.php before writing echo"how are you ? " ;


    you have written include("one.php");
    or
    the full path of your file one.php (if it is hosted on another website or in different folder



    then the output will be



    Hello How are you ?


    as it has included one.php executed the code in one.php and then shown the code written in two.php

  • #5
    New Coder
    Join Date
    Nov 2011
    Location
    India
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    So you mean I should upload the menu.php somewhere and get the link.
    Then I should paste the link in the red area?
    <?php include("menu.php"); ?>
    <p>This is my home page that uses a common menu to save me time when I add
    new pages to my website!</p>
    </body>
    </html>
    And then paste the whole include.php in middle of my html code of the page? Right?

  • #6
    New Coder
    Join Date
    Nov 2011
    Location
    India
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    *BUMP*
    Can you please tell?

  • #7
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,852
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Quote Originally Posted by Sharkhead View Post

    And then paste the whole include.php in middle of my html code of the page? Right?
    Yes, but you probably(unless you configure your server) need to change the extension of your files from .htm/.html to .php, in order to execute the include() or any php statements.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #8
    New Coder
    Join Date
    Nov 2011
    Location
    India
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Excavator View Post
    Hello Sharkhead,
    Maybe a better/different tutorial would help - http://www.tizag.com/phpT/include.php
    Helped a lot.
    Thanks...

  • #9
    New Coder
    Join Date
    Nov 2011
    Location
    India
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry for reopening/bumping,
    Hey Excavator, that information of the link you gave works like a charm. But as I mentioned before, I need the external file to show the image directly. Right now its giving me the link towards the banner.
    So instead of showing the banner image, its showing the link towards the image.
    Any help on this?

  • #10
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,675
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Quote Originally Posted by Sharkhead View Post
    Sorry for reopening/bumping,
    Hey Excavator, that information of the link you gave works like a charm. But as I mentioned before, I need the external file to show the image directly. Right now its giving me the link towards the banner.
    So instead of showing the banner image, its showing the link towards the image.
    Any help on this?
    Let's have a look at the most current version of your code. Even better, since there are images involved with your issue, a link to the test site.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #11
    New Coder
    Join Date
    Nov 2011
    Location
    India
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sorry, but I don't have a test site. All the files are on my computer itself and I'm working on like that. Any place where I could upload the .htm files and give you a link?
    Ashes to Ashes and Dust to Dust, if it wasn't for those bada$$ Peterbilts, the Hammer Lane would Rust.

  • #12
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,852
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Any place where I could upload the .htm files and give you a link?
    http://www.maclife.com/article/howto...ebsite_dropbox
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

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