Very Easy Question

Discussion in 'HTML & Website Design' started by geekazoid, Jul 2, 2006.

  1. #1
    This question, Allthough im not familliar with how to do it, Im sure will show me up with the ease in which it is performed. What im looking for is a code to put into a php file which will show a .html file in it ?

    For example i would place lots of text in one .html file and then link to it useing the script. So it would show on my php page in a chosen place somewhere on the page.

    Now say i put the same line of script in 300 pages i could change all of those pages by just changing that one .html file. See ?

    So would someone be able to help me please ? Thanx.
     
    geekazoid, Jul 2, 2006 IP
  2. YIAM

    YIAM Notable Member

    Messages:
    2,480
    Likes Received:
    240
    Best Answers:
    0
    Trophy Points:
    280
    #2
    <?php include("abcd.html");?>
     
    YIAM, Jul 2, 2006 IP
  3. ahref

    ahref Well-Known Member

    Messages:
    1,123
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    170
    #3
    you can also use
    <?php require "abcd.html" ?>
     
    ahref, Jul 2, 2006 IP
  4. geekazoid

    geekazoid Peon

    Messages:
    208
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Exactly what i was looking for, Thanx guys
     
    geekazoid, Jul 2, 2006 IP
  5. Baxter7

    Baxter7 Well-Known Member

    Messages:
    189
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #5
    use include or read the file into a variable
     
    Baxter7, Jul 3, 2006 IP
  6. geekazoid

    geekazoid Peon

    Messages:
    208
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    OK cool but is there a way of doing it without php ?
     
    geekazoid, Jul 7, 2006 IP
  7. the_pm

    the_pm Peon

    Messages:
    332
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    0
    #7
    It can be done with .asp or as a server-side include (SSI)

    SSI and ASP includes:
    <!--#include file="included.html" --> - same directory
    <!--#include virtual="/directory/included.html" --> - different directory
     
    the_pm, Jul 7, 2006 IP
  8. geekazoid

    geekazoid Peon

    Messages:
    208
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    The Pm ! Brilliant Thats cool Ta !
     
    geekazoid, Jul 7, 2006 IP