Adding PHP code to a .shtml page

I have written several web pages with the file extension .shtml containing  <!--#include virtual="Include/" --> in them and everything works okay. I have added some PHP to these web pages and I now have problems.
When I continue to use file extension .shtml the php code does not get parsed. When I use the file extension .php my <!--#include virtual="Include/" --> data is missing from the screen. I assume it is not getting parsed because the file extension is not .shtml.
My question. What file extension should I be using and what should the code look like to get these two functions to co-habitat in the same page?
Thanks for your time and help.
Who is Participating?
cobra502Author Commented:
I have figured it out. I created a file using the php code I wanted to put into the shtml file and saved it as getphpcode.php. Then using the original .shtml program that was working okay, I added
        <!--#include virtual="getphpcode.php" -->
to the .shtml program.
So I guess the include is handled by the server and when the server sees the php code it parses it.

Guess you need to name to NavigateG2.php or you need to add the extension .inc to be pared as a php-file
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.