I'm trying to include a file if the url includes /forum/ with the following code but I can't seem to get it too work. $urlForum = strpos($_SERVER["REQUEST_URI"], "/forum/"); if ($urlForum == false) {require_once 'memberpanel.php';} else {require_once 'forumPanel.php';} PHP:
Untested, but please try this if (stristr($_SERVER["REQUEST_URI"], "/forum/")) { require_once 'forumPanel.php'; } else { require_once 'memberpanel.php'; } PHP: You can use some regular expression, but in this case, stristr is faster.