Hey everyone... I'm not too familiar with PHP... but I have PHP code that basically "includes" a file if a condition exists. This PHP code is going to be pretty lengthy and I was wondering if it was possible to create a .php file, and just INCLUDE THAT in my shtml files? What the below is doing is placing the correct navigation bar in the shtml file by running a series of if/else statements in PHP. If the REQUEST_URI (the current page) is xxxxx.shtml, then include THIS navigation bar file, etc. This is working perfectly, but as you can imagine for a site that has hundreds of pages, I would have to place each page in this below "conditional server side includes"- and the disadvantage to this is if some menu items get rearranged in the navigation bars, I want to be able to just edit ONE PHP file rather than every single shtml file that includes the below script. I HAVE NO IDEA how to include the below PHP into it's own file. I assume I need to leave out the as that's specific to HTML. But aside from that, is it just as easy as copying and pasting the above into it's own PHP file?
Currently, here's what I have in every one of my shtml files (it WILL get bigger, this is to just start out):
<!--#if expr="$REQUEST_URI = /1/"-->
<!--#include virtual="navFiles/featuresCurrent.shtml" -->
<!--#elif expr="$REQUEST_URI = /2/"-->
<!--#include virtual="navFiles/videosCurrent.shtml" -->
<!--#elif expr="$REQUEST_URI = /3/"-->
<!--#include virtual="navFiles/aboutusCurrent.shtml" -->
<!--#elif expr="$REQUEST_URI = /4/"-->
<!--#include virtual="navFiles/subscribeCurrent.shtml" -->
<!--#elif expr="$REQUEST_URI = /5/"-->
<!--#include virtual="navFiles/toolsCurrent.shtml" -->
<!--#elif expr="$REQUEST_URI = /6/"-->
<!--#include virtual="navFiles/membershipCurrent.shtml" -->
<!--#endif -->
I want to be able to create an individual .php file that contains the above code, and instead of putting the ABOVE in my shtml pages, I would just put something like "include xxxx.php". Is this possible?