Forum Moderators: coopster
For example, I would like the include to happen if the address is
example.com/[b]widgets[/b]/whatever.htm but not if the directory is called anything other than "widgets". Is there an easy way to make an include conditional on an URL string?
Many thanks for your help!
if(strpos($_SERVER['PHP_SELF'], '/widgets/')!== FALSE) {
include 'conditionalinclude.php';
}
* note the "!==" and not "!=" ; this needs to check for type as well as value, since 0 returned from
strposwould mean starting at the beginning of the string.