# Php code not working in HTML page

**URL:** <https://forums.realmacsoftware.com/t/php-code-not-working-in-html-page/14237>\
**Category:** RapidWeaver Classic\
**Created:** [May 21, 2017, 1:31pm UTC](https://forums.realmacsoftware.com/t/php-code-not-working-in-html-page/14237 "2017-05-21T13:31:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jandavid](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jandavid](https://forums.realmacsoftware.com/u/jandavid)\
**Post date:** [May 21, 2017, 1:31pm UTC](https://forums.realmacsoftware.com/t/php-code-not-working-in-html-page/14237/1 "2017-05-21T13:31:28Z")

</div>

Hello everyone,  
I am trying to embed a bit of PHP code in the sidebar of a styled text page with the file extension .html. As I understand it, the php code I put between \<?php ... ?\> should be executed even on an .html page. I tried to place a very simple code an the main part of the page as well as in the sidebar and it is not showing up.

```
<?php echo "Hello"; ?>

```

I marked the code with “Ignore Formatting” and tried to switch the sidebar to html. All to no avail. If anyone has any idea, what I might be missing, it would be much appreciated. I am using RW 7.4 and “Lander” as the theme.  
Thanks a lot!

---

<div class="post-metadata">

**Author:** ![instacks](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/instacks/32/23339_2.png) [@instacks](https://forums.realmacsoftware.com/u/instacks)\
**Post date:** [May 21, 2017, 1:38pm UTC](https://forums.realmacsoftware.com/t/php-code-not-working-in-html-page/14237/2 "2017-05-21T13:38:07Z")

</div>

PHP coding will not pe executed on a .html page. The page must end with .php in order to execute PHP coding.

---

<div class="post-metadata">

**Author:** ![jandavid](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jandavid](https://forums.realmacsoftware.com/u/jandavid)\
**Post date:** [May 21, 2017, 11:06pm UTC](https://forums.realmacsoftware.com/t/php-code-not-working-in-html-page/14237/3 "2017-05-21T23:06:26Z")

</div>

Thanks a lot, for that easy fix. Seems I completely misunderstood the concept. Much obliged!

---

<div class="post-metadata">

**Author:** ![1611mac](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/1611mac/32/5675_2.png) [@1611mac](https://forums.realmacsoftware.com/u/1611mac)\
**Post date:** [May 22, 2017, 12:31pm UTC](https://forums.realmacsoftware.com/t/php-code-not-working-in-html-page/14237/4 "2017-05-22T12:31:16Z")

</div>

With some isp’s, you can put code in your htaccess file that will force your html pages to process as php. I had hundreds of pages to “change over” and I didn’t want to lose my incoming links so I left pages as html and configured server to treat all pages as php.
