Link to home
Start Free TrialLog in
Avatar of csehz
csehzFlag for Hungary

asked on

PHP code in index.html

Dear Experts,

I have a small php code which put to a html file, named as test.html and this works fine, including the file content of aside1.html in test.html.

The strange is that if I rename this test.html to index.html, somehow it does now work, not loading the file content. Do you have idea why? Simple the different file name can have such effect?

thanks,

  <div id="aside1">
    <?php
     <!--#include file="aside1.html" -->
    ?>
   </div>

Open in new window

Avatar of csehz
csehz
Flag of Hungary image

ASKER

I am afraid using something wrong in the syntax, could you please advise is it the way like in the attached code to put php into div?

thanks,
ASKER CERTIFIED SOLUTION
Avatar of DrDamnit
DrDamnit
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of csehz

ASKER

Thanks very much
Avatar of csehz

ASKER

Just for me a conclusion to the future so if the file is

1) index.html - in that case this

     <!--#include file="aside1.html" -->

is enough without any php tags.

2) index.php - in that case it works with

<?php
     include('aside1.html');
    ?>

thanks,
<!--#include file="aside1.html" -->

Open in new window


Yes. This is an html include, but will  NOT process any PHP.
Avatar of csehz

ASKER

Thanks just again