how to use include in html?

Discussion in 'HTML & Website Design' started by irfan.goodluck, Feb 29, 2012.

  1. #1
    how to use include in html..? please post here or PM me...
     
    irfan.goodluck, Feb 29, 2012 IP
  2. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #2
    <html>
    <body>
    <p>include</p>
    </body>
    </html>
    Code (markup):
    .
     
    drhowarddrfine, Feb 29, 2012 IP
  3. popartns

    popartns Member

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #3
    Omg this is not happening. You can not include files in html if that was your intention.
     
    popartns, Mar 1, 2012 IP
  4. GMF

    GMF Well-Known Member

    Messages:
    855
    Likes Received:
    113
    Best Answers:
    19
    Trophy Points:
    145
    #4
    Plane HTML cannot do this... You could use SSI (server side include) or PHP...

    Here is a SSI Tutorial
    http://http-server.carleton.ca/~dmcfet/html/ssi.html
    Code (markup):
     
    GMF, Mar 1, 2012 IP
  5. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #5
    What do you mean? This is DP where anything can happen and questions like this are the norm.
     
    drhowarddrfine, Mar 1, 2012 IP
  6. Rowefx

    Rowefx Peon

    Messages:
    28
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    +1, anything is a possiblity! zmggg!
     
    Rowefx, Mar 2, 2012 IP
  7. neil_buzzerchat_staff

    neil_buzzerchat_staff Banned

    Messages:
    470
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    28
    #7
    you can use ssi in html but cannot use php include, hope this helps.
     
    neil_buzzerchat_staff, Mar 2, 2012 IP
  8. 137th Gebirg

    137th Gebirg Active Member

    Messages:
    70
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #8
    AH! But you CAN include HTML inside HTML! And not with that SSI .htaccess kludge and you don't need PHP or any other server-side language to do it.

    Using AJAX - Call a remote HTML file with AJAX in the onLoad event handler of the body and place the returned page inside a blank DIV layer in the first HTML file. You might notice a slight lag as the sub-pages load up, depending on the speed of your server, but it works flawlessly and you can do it for as many files as you want to include.

    Edit - I guess you could also use iFrames, but nowadays, that's all kinds of "ick".
     
    Last edited: Mar 13, 2012
    137th Gebirg, Mar 13, 2012 IP
  9. walidsu

    walidsu Member

    Messages:
    82
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    28
    #9
    You cannot use include in html, but you can use iframe

    Example:

    <iframe width="" height="" src="www.yourlinkgoesher.com/blablab.html" scrolling='no' noresize="noresize">
     
    walidsu, Mar 14, 2012 IP
  10. Ashaya

    Ashaya Active Member

    Messages:
    124
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    83
    #10
    I guess you are talking about the php include! if so, then here is how you can use it- "<?php include("url-of-the-file.php"); ?>"replace url-of-the-file with the exact url of your file that you wan't to include! for example, if you've created a file called nav-menu and it is on the public_html folder then the url would be only the name of the file i.e., in this case- nav-menu.php. while using this code do make sure that the included file should just contain the content, no any extra tags like , or anything else!
     
    Ashaya, Mar 18, 2012 IP
  11. martin_style

    martin_style Greenhorn

    Messages:
    80
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #11
    I think HTML not support tag include, if you want include file you can use PHP, ASP, ...
     
    martin_style, Mar 18, 2012 IP
  12. web.seowrkshop

    web.seowrkshop Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    in php you can use include like this = "<?php include("url-of-the-file.php"); ?>"
    in html thee is no ny include named property. you can use the simple include in hml like this
    <body>
    <p>include</p>
    </body>

    yu can use include in any tag in html.
     
    web.seowrkshop, Apr 27, 2012 IP
  13. MobileInternet

    MobileInternet Active Member

    Messages:
    365
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    58
    #13
    great advice from previous posts
     
    MobileInternet, Apr 27, 2012 IP