1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Any method to include HTML page in an another HTML Page other than IFRAME, php includ

Discussion in 'HTML & Website Design' started by kslokesh, Nov 27, 2009.

  1. #1
    Is there any method by which we can add another page into the HTML Page without using IFRAME ?

    Javascript can be used but the links in it cant be followed by robots.

    php include is best and its for .php files, But I want to use only .html or .htm as extension..

    using .htaccess to parse html as php and adding php include code will result in invalid markup validation in w3 validator.

    So is there any other method by which i can just add a line of code for header and footer into the html pages.

    Please tell me.
     
    Last edited: Nov 27, 2009
    kslokesh, Nov 27, 2009 IP
  2. cbryant03

    cbryant03 Member

    Messages:
    71
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #2
    only way I know to do this to still make the pages parse html is to use php and then smarty code as a template for it

    other than that if all you have is a huge amount of html pages, you might need to convert them all to php or something. There are some conversion tools you can search google and find to do this.

    Make sure you find one that will update links to the new extensions, because you dont want to have to do that manually or even find/replace.

    Also make sure you have some 404 pages setup after you do this conversion if you, cuz your pages will drop out of search engines
     
    cbryant03, Nov 27, 2009 IP
  3. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #3
    What he means is that you can tell the server to process ( parse) html pages like they are PHP. You still have html as the extension but you can use PHP code on the pages. I do this on more than one of my sites.

    The actual syntax for the .htaccess file will vary a little depending on the PHP vesion and wheter or or not suexec is used.

    I hate smarty and would never use it.
     
    Colbyt, Nov 27, 2009 IP
  4. kslokesh

    kslokesh Well-Known Member

    Messages:
    153
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    105
    #4
    My website contains a max of 50 pages...

    But if we make the html to be parsed as php, will it get validated correctly in w3 validator?

    It may show the php tags <? as validation errors ? ? ?

    has anyone validated the html pages which is been parsed as php ?
     
    kslokesh, Nov 28, 2009 IP
  5. Colbyt

    Colbyt Notable Member

    Messages:
    3,224
    Likes Received:
    185
    Best Answers:
    0
    Trophy Points:
    210
    #5
    PHP:
    Not if you call the correct document type.

    Mine had errors, not that I care but that wasn't one of them.


    I could clean up the displayed errors, mostly <br> instead of <br /> and it would validate.


    Here read it for yourself. Add http:// to the contents of the text box below:

    validator.w3.org/check?uri=http%3A%2F%2Fmy-e-space.com&charset=%28detect+automatically%29&doctype=Inline&group=0
    PHP:
     
    Colbyt, Nov 28, 2009 IP
    kslokesh likes this.