Including the same content for several pages

Asked

Viewed 62 times

0

I’m developing a website that will have a growing number of pages. I would like to know if you can help me in how to include the same content on several pages as follows:

All pages are extended php but programmed in html;

I have a file footnote.php and I would like to include it in <div id="rodape">;

I tried to include through the code <?= include ("rodape_conteudo.php") ;?> which is what the research I’ve done has always returned to me, but this way, it’s not happening.

The content at the time I run the site is blank, as if the code returned nothing.

This could be a mistake on the part of <?...> or in the code of footnote.php?

  • Do not use <?= include, after all, you are not trying to print anything. Prefer to use <?php include.

1 answer

1

Include will not work with <?=. That one tag is a shortening of echo in the PHP. If you don’t want to print anything, use <?php, and not <?=.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.